"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "examples/devel/webgui01.py" between
pymol-v1.8.6.0.tar.bz2 and pymol-v2.1.0.tar.bz2

About: PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source version.

webgui01.py  (pymol-v1.8.6.0.tar.bz2):webgui01.py  (pymol-v2.1.0.tar.bz2)
import SocketServer try:
import BaseHTTPServer import BaseHTTPServer
except ImportError:
import http.server as BaseHTTPServer
import time import time
import cgi import cgi
import threading import threading
import traceback import traceback
from pymol import cmd from pymol import cmd
_server = None _server = None
def _shutdown(self_cmd=cmd): def _shutdown(self_cmd=cmd):
skipping to change at line 160 skipping to change at line 162
def do_POST(self): def do_POST(self):
global rootnode global rootnode
try: try:
ctype, pdict = cgi.parse_header(self.headers.getheader('content-type ')) ctype, pdict = cgi.parse_header(self.headers.getheader('content-type '))
if ctype == 'multipart/form-data': if ctype == 'multipart/form-data':
query=cgi.parse_multipart(self.rfile, pdict) query=cgi.parse_multipart(self.rfile, pdict)
self.send_response(301) self.send_response(301)
self.end_headers() self.end_headers()
upfilecontent = query.get('upfile') upfilecontent = query.get('upfile')
print "filecontent", upfilecontent[0] print("filecontent", upfilecontent[0])
self.wfile.write('<HTML>POST OK.<BR><BR>'); self.wfile.write('<HTML>POST OK.<BR><BR>');
self.wfile.write(upfilecontent[0]); self.wfile.write(upfilecontent[0]);
except : except :
pass pass
def main(): def main():
try: try:
global _server global _server
_server = BaseHTTPServer.HTTPServer(('', 8080), PymolHandler) _server = BaseHTTPServer.HTTPServer(('', 8080), PymolHandler)
print 'started httpserver...' print('started httpserver...')
_server.serve_forever() _server.serve_forever()
except KeyboardInterrupt: except KeyboardInterrupt:
print '^C received, shutting down server' print('^C received, shutting down server')
_server.socket.close() _server.socket.close()
def open_browser(): def open_browser():
import webbrowser import webbrowser
time.sleep(1) time.sleep(1)
webbrowser.open('http://localhost:8080/status.pymol') webbrowser.open('http://localhost:8080/status.pymol')
# import os # import os
# os.system('open http://localhost:8080/start.pymol') # os.system('open http://localhost:8080/start.pymol')
if __name__ == '__main__': if __name__ == '__main__':
 End of changes. 4 change blocks. 
5 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)