Commit 888ec97e authored by Jérome Perrin's avatar Jérome Perrin

py3: modernize -j20 --write -f print **py

parent 037c5ac5
......@@ -14,8 +14,8 @@
import os.path
data = str(context.file_system_checksum).strip()
lines = data.split("\n")
print "Total files = ", len(lines)
print
print("Total files = ", len(lines))
print()
check_result = True
for line in lines[:]:
md5_checksum = line[:32].strip()
......@@ -27,16 +27,16 @@ for line in lines[:]:
"reference": reference}
data_stream = context.portal_catalog.getResultValue(**catalog_kw)
if data_stream is None:
print "[NOT FOUND]", reference
print("[NOT FOUND]", reference)
check_result = False
else:
is_upload_ok = (data_stream.getVersion()==md5_checksum)
print md5_checksum, filename, data_stream is not None, is_upload_ok
print(md5_checksum, filename, data_stream is not None, is_upload_ok)
if not is_upload_ok:
check_result = False
print
print()
if check_result:
print "[OK] Data set correctly uploaded"
print("[OK] Data set correctly uploaded")
else:
print "[ERROR] Data set was not correctly uploaded"
print("[ERROR] Data set was not correctly uploaded")
return printed
......@@ -7,14 +7,14 @@ from DateTime import DateTime
old_date = DateTime(2019, 12, 31)
catalog_kw = {'modification_date': {'query': old_date, 'range': '<='}}
print "Following Dataset were invalidated:"
print("Following Dataset were invalidated:")
for data_set in portal_catalog(portal_type="Data Set", **catalog_kw):
print
print "DATASET: " + data_set.getReference()
print "state: " + data_set.getValidationState()
print "date: " + str(data_set.getModificationDate())
print "len of datastream list: " + str(len(data_set.DataSet_getDataStreamList()))
print()
print("DATASET: " + data_set.getReference())
print("state: " + data_set.getValidationState())
print("date: " + str(data_set.getModificationDate()))
print("len of datastream list: " + str(len(data_set.DataSet_getDataStreamList())))
for data_stream in data_set.DataSet_getDataStreamList():
if data_stream is not None:
portal.ERP5Site_invalidateIngestionObjects(data_stream.getReference())
......
for i in context.keras_vgg16_predict(context.image_module[image_document_id]):
print i
print(i)
return printed
......@@ -266,11 +266,11 @@ class CategoryProcessor(object):
field_category_name = field+'_category'
field_name = field+'_uid'
if verbose:
print 'Processing %s' % field_name
print('Processing %s' % field_name)
uids = [str(row[0]) for row in array[:][[field_name]]]
objects = self.context.portal_catalog(uid=uids)
if verbose:
print 'Found %s %s' % (len(objects), field)
print('Found %s %s' % (len(objects), field))
for resource in objects:
categories = resource.getCategoryList()
......@@ -280,8 +280,8 @@ class CategoryProcessor(object):
category_uids.append(str(categories_df.ix[category]['uid']))
except KeyError:
if verbose:
print 'Category %s not found from %s' % (category, field_category_name)
print '...adding to the DataFrame.'
print('Category %s not found from %s' % (category, field_category_name))
print('...adding to the DataFrame.')
categories_df.loc[category] = self.context.portal_categories.resolveCategory(category).getUid()
fields_objects_categories[field][int(resource.getUid())] = ','.join(category_uids)
......@@ -314,7 +314,7 @@ class CategoryProcessor(object):
row[field_category_name] = categories
transaction.commit()
if duplicate_category:
print 'Duplication added to the array: %s' % total_duplication
print('Duplication added to the array: %s' % total_duplication)
return
def _getCategoriesDf(self):
......
......@@ -67,5 +67,5 @@ configuration_save.addConfigurationItem("Portal Type Roles Spreadsheet Configura
# Create ERP5Site_getSecurityCategoryMapping
configuration_save.addConfigurationItem("Security Category Mapping Configurator Item")
print "Created."
print("Created.")
return printed
......@@ -11,4 +11,4 @@ bme280.setup()
data = bme280.read_all()
print("{}\t{}\t{}".format(data.pressure, data.humidity, data.temperature))
print(("{}\t{}\t{}".format(data.pressure, data.humidity, data.temperature)))
......@@ -25,4 +25,4 @@ r = requests.post(ingestion_policy_url,
headers=headers)
if r.status_code >= 200 and r.status_code<=204:
print "Successfully uploaded %s bytes to Wendelin." %len(payload)
print("Successfully uploaded %s bytes to Wendelin." %len(payload))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment