def submit_pdb2pqr(): """ Handles PDB2PQR job submissions. Runs the PDB2PQR main function originally from 'main_cgi.py'. """ if request.method == 'POST': redirectURL = main_cgi.mainCGI(request.form, request.files, STORAGE_HOST) '''=== DEBUG LINE FOR DEV: REMOVE IN FINAL ===''' if 'http://localhost:5000' in redirectURL: print(redirectURL) redirectURL = redirectURL.replace('http://localhost:5000', 'http://localhost:3000') print(redirectURL) '''===========================================''' return redirect(redirectURL)
def submit_pdb2pqr_json(): """ Handles PDB2PQR job submissions. Runs the PDB2PQR main function originally from 'main_cgi.py'. """ if request.method == 'POST': # form_json # print(pp.pformat(request.form.to_dict(), indent=4, width=10)) pp.pprint(request.form.to_dict()) print(type(request.form)) print(type(request.form.to_dict())) redirectURL = main_cgi.mainCGI(request.form, request.files, STORAGE_HOST) '''=== DEBUG LINE FOR DEV: REMOVE IN FINAL ===''' if 'http://localhost:5000' in redirectURL: print(redirectURL) redirectURL = redirectURL.replace('http://localhost:5000', 'http://localhost:3000') print(redirectURL) '''===========================================''' return redirect(redirectURL)
def jobstatus(): """ GET takes the user directly to the status page A query string in the URL is how the status page is rendered """ if request.method == 'POST': # f = request.files['PDB'] # print("f is of type: "+str(type(f))) # print(f['PDB']) # filename = secure_filename(f.filename) # print('filename: ' + filename) job_type = request.args['submitType'] # print(job_type) # print(request.args) if job_type == 'pdb2pqr': redirectURL = main_cgi.mainCGI(request.form, request.files) elif job_type == 'apbs': print(pp.pformat(request.form.to_dict(), indent=4, width=10)) # return pp.pformat(request.form.to_dict(), indent=4, width=10) # return str(request.form) # return str(request.form['removewater']) redirectURL = apbs_cgi.mainInput(request.form) pass '''=== DEBUG LINE FOR DEV: REMOVE IN FINAL ===''' if ':5000' in redirectURL: print(redirectURL) redirectURL = redirectURL.replace(':5000', ':3000') print(redirectURL) '''===========================================''' return redirect(redirectURL) elif request.method == 'GET': return render_template("index.html")
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ __date__ = "5 April 2010" __author__ = "Todd Dolinsky, Nathan Baker, Jens Nielsen, Paul Czodrowski, Jan Jensen, Samir Unni, Yong Huang" import sys, os from main import mainCommand from main_cgi import mainCGI from src.aconf import * __version__ = PDB2PQR_VERSION if __name__ == "__main__": """ Determine if called from command line or CGI """ if not os.environ.has_key("REQUEST_METHOD"): mainCommand(sys.argv) else: mainCGI()
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ __date__ = "5 April 2010" __author__ = "Todd Dolinsky, Nathan Baker, Jens Nielsen, Paul Czodrowski, Jan Jensen, Samir Unni, Yong Huang" import sys,os from main import mainCommand from main_cgi import mainCGI from src.aconf import * __version__ = PDB2PQR_VERSION if __name__ == "__main__": """ Determine if called from command line or CGI """ if not os.environ.has_key("REQUEST_METHOD"): mainCommand(sys.argv) else: mainCGI()