Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pdbfixer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pdbfixer
Commits
ddd45d37
Commit
ddd45d37
authored
Feb 10, 2015
by
Matthew Harrigan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some bytes issues
parent
a5e76b21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
pdbfixer/pdbfixer.py
+1
-1
pdbfixer/ui.py
+10
-3
pdbfixer/uiserver.py
+1
-1
No files found.
pdbfixer/pdbfixer.py
View file @
ddd45d37
...
...
@@ -208,7 +208,7 @@ class PDBFixer(object):
self
.
source
=
url
file
=
urlopen
(
url
)
# Read contents all at once and split into lines, since urlopen doesn't like it when we read one line at a time over the network.
contents
=
file
.
read
()
contents
=
file
.
read
()
.
decode
(
'utf-8'
)
lines
=
contents
.
split
(
'
\n
'
)
file
.
close
()
structure
=
PdbStructure
(
lines
)
...
...
pdbfixer/ui.py
View file @
ddd45d37
...
...
@@ -29,7 +29,7 @@ def loadImageFile(name):
if
name
not
in
cachedImages
:
imagePath
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'images'
)
file
=
os
.
path
.
join
(
imagePath
,
name
)
cachedImages
[
name
]
=
open
(
file
)
.
read
()
cachedImages
[
name
]
=
open
(
file
,
'rb'
)
.
read
()
return
cachedImages
[
name
]
def
controlsCallback
(
parameters
,
handler
):
...
...
@@ -61,8 +61,15 @@ def startPageCallback(parameters, handler):
id
=
parameters
.
getfirst
(
'pdbid'
)
try
:
fixer
=
PDBFixer
(
pdbid
=
id
)
except
:
handler
.
sendResponse
(
header
+
"Unable to download the PDB file. This may indicate an invalid PDB identifier, or an error in network connectivity."
+
loadHtmlFile
(
"error.html"
))
except
Exception
as
e
:
import
traceback
print
(
traceback
.
format_exc
())
handler
.
sendResponse
(
header
+
"<p>Unable to download the PDB file. "
+
"This may indicate an invalid PDB identifier, "
+
"or an error in network connectivity.</p>"
+
"<p>{}</p>"
.
format
(
e
)
+
loadHtmlFile
(
"error.html"
))
displayDeleteChainsPage
()
def
deleteChainsPageCallback
(
parameters
,
handler
):
...
...
pdbfixer/uiserver.py
View file @
ddd45d37
...
...
@@ -46,7 +46,7 @@ class _Handler(BaseHTTPRequestHandler):
self
.
send_header
(
"Content-type"
,
type
)
self
.
send_header
(
"Content-length"
,
str
(
len
(
response
)))
self
.
end_headers
()
if
sys
.
version_info
.
major
>
2
:
if
sys
.
version_info
.
major
>
2
and
isinstance
(
response
,
str
)
:
response
=
bytes
(
response
,
'UTF-8'
)
self
.
wfile
.
write
(
response
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment