From 782d0dc7485f9ea94cdb998a23cedb8672ecb3c6 Mon Sep 17 00:00:00 2001 From: towstone Date: Sat, 24 Oct 2020 09:31:17 -0500 Subject: [PATCH] updated print to work with python 3 --- lib/submit_api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/submit_api.py b/lib/submit_api.py index 3228f7b509..a98d9fd6b5 100644 --- a/lib/submit_api.py +++ b/lib/submit_api.py @@ -123,7 +123,7 @@ class REQUEST: rpc_timeout = 0 def do_http_post(req, project_url, handler='submit_rpc_handler.php'): - #print req + #print(req) url = project_url + handler params = urllib.urlencode({'request': req}) if rpc_timeout>0: @@ -132,7 +132,7 @@ def do_http_post(req, project_url, handler='submit_rpc_handler.php'): f = urllib2.urlopen(url, params) reply = f.read() - #print "REPLY:", reply + #print("REPLY:", reply) return ET.fromstring(reply) ########### API FUNCTIONS START HERE ############### @@ -226,7 +226,7 @@ def submit_batch(req): # def check_error(response): if response.find('error') is not None: - print 'BOINC server error: ', response.find('error').find('error_msg').text + print('BOINC server error: ', response.find('error').find('error_msg').text) return True ############ FILE MANAGEMENT API ############## @@ -276,7 +276,7 @@ def upload_files(upload_files_req): return reply absent = reply.find('absent_files').findall('file') - #print 'query files succeeded; ',len(absent), ' files need upload' + #print('query files succeeded; ',len(absent), ' files need upload') boinc_names = [] local_names = [] for n in absent: @@ -297,10 +297,10 @@ def upload_files(upload_files_req): url = upload_files_req.project + '/job_file.php' req_xml = upload_files_req.to_xml() - #print req_xml + #print(req_xml) req = {'request': req_xml} reply = requests.post(url, data=req, files=files) - #print "reply text: ", reply.text + #print("reply text: ", reply.text) return ET.fromstring(reply.text) # returns an XML object with various job counts