Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
wendelin
Commits
888ec97e
Commit
888ec97e
authored
Nov 18, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: modernize -j20 --write -f print **py
parent
037c5ac5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
22 deletions
+22
-22
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/DataSet_checkMd5DataStreamList.py
...erp5_wendelin_data_lake/DataSet_checkMd5DataStreamList.py
+7
-7
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateOldDatasets.py
...erp5_wendelin_data_lake/ERP5Site_invalidateOldDatasets.py
+6
-6
bt5/erp5_wendelin_examples_keras/SkinTemplateItem/portal_skins/erp5_wendelin_examples_keras/call_keras_vgg16_predict.py
.../erp5_wendelin_examples_keras/call_keras_vgg16_predict.py
+1
-1
bt5/erp5_wendelin_inventory/ExtensionTemplateItem/portal_components/extension.erp5.PandasInventory.py
...eItem/portal_components/extension.erp5.PandasInventory.py
+5
-5
bt5/erp5_wendelin_scalability_test/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_test/BusinessConfiguration_setupWendelinConfigurationSave.py
...t/BusinessConfiguration_setupWendelinConfigurationSave.py
+1
-1
tutorial/kbme280-sim.py
tutorial/kbme280-sim.py
+1
-1
utils/sample_wendelin_upload.py
utils/sample_wendelin_upload.py
+1
-1
No files found.
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/DataSet_checkMd5DataStreamList.py
View file @
888ec97e
...
...
@@ -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
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateOldDatasets.py
View file @
888ec97e
...
...
@@ -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
())
...
...
bt5/erp5_wendelin_examples_keras/SkinTemplateItem/portal_skins/erp5_wendelin_examples_keras/call_keras_vgg16_predict.py
View file @
888ec97e
for
i
in
context
.
keras_vgg16_predict
(
context
.
image_module
[
image_document_id
]):
print
i
print
(
i
)
return
printed
bt5/erp5_wendelin_inventory/ExtensionTemplateItem/portal_components/extension.erp5.PandasInventory.py
View file @
888ec97e
...
...
@@ -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
):
...
...
bt5/erp5_wendelin_scalability_test/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_test/BusinessConfiguration_setupWendelinConfigurationSave.py
View file @
888ec97e
...
...
@@ -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
tutorial/kbme280-sim.py
View file @
888ec97e
...
...
@@ -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
)
))
utils/sample_wendelin_upload.py
View file @
888ec97e
...
...
@@ -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
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment