Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated print to work with python 3 #4070

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/submit_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self):
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:
Expand All @@ -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 ###############
Expand Down Expand Up @@ -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 ##############
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down