I was just working through the Plugin tutorial
Writing the plugin from the tutorial as is shown, I happen to
receive a gzip error (from the Python Shell):
>>> zlib.decompress(pdbFile.read()[22:], -zlib.MAX_WBITS)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
zlib.error: Error -5 while decompressing data
So I figured, why is the PDB file decompressed in the first place,
why not just call the PDB file directly from the PDB database:
pdbCode = pdbCode.upper()
pdbFile = urllib2.urlopen('http://www.pdb.org/pdb/files/'
#pdbFile = urllib2.urlopen('http://www.rcsb.org/pdb/cgi/export.cgi/' +
# pdbCode + '.pdb.gz?format=PDB&pdbId=' +
# pdbCode + '&compression=gz')
print "Unexpected Error:", sys.exc_info()
tkMessageBox.showerror('Invalid Code', pdbCode)
This seems to work fine in the sense that the PDB file is correctly
downloaded and loaded into the PyMOL viewer.
I have two questions now:
1) Are there any problems I could run into using this approach?
2) I was thinking its a bit tedious to reinstall a plugin everytime
I change a single line of code. Is there an easy and smart way to
see how new code is working within PyMOL without having to reinstall
the plugin all the time?
Thanks for any suggestions.