Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
erp5
Commits
326a1655
Commit
326a1655
authored
Mar 28, 2022
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
e78ac944
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
42 deletions
+52
-42
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+5
-8
product/ERP5Type/Tool/WorkflowTool.py
product/ERP5Type/Tool/WorkflowTool.py
+16
-1
product/ERP5Type/dynamic/component_package.py
product/ERP5Type/dynamic/component_package.py
+4
-3
product/ERP5Type/patches/ppml.py
product/ERP5Type/patches/ppml.py
+26
-29
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+1
-1
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
326a1655
...
...
@@ -97,11 +97,7 @@ from warnings import warn
from
lxml.etree
import
parse
from
xml.sax.saxutils
import
escape
from
Products.CMFCore.Expression
import
Expression
import
six
if
six
.
PY2
:
from
urllib.parse
import
quote
,
unquote
else
:
from
urllib.parse
import
quote_from_bytes
as
quote
,
unquote_to_bytes
as
unquote
from
urllib.parse
import
quote
,
unquote
from
difflib
import
unified_diff
import
posixpath
import
transaction
...
...
@@ -1042,7 +1038,7 @@ class ObjectTemplateItem(BaseTemplateItem):
F
.
binary
=
1
F
.
file
=
outfile
p
=
xml
.
parsers
.
expat
.
ParserCreate
(
'utf-8'
)
p
.
returns_unicode
=
Fals
e
p
.
buffer_text
=
Tru
e
p
.
CharacterDataHandler
=
F
.
handle_data
p
.
StartElementHandler
=
F
.
unknown_starttag
p
.
EndElementHandler
=
F
.
unknown_endtag
...
...
@@ -5928,11 +5924,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
prop_type
=
prop
[
'type'
]
value
=
bt_item
.
get
(
pid
)
if
prop_type
in
(
'text'
,
'string'
):
prop_dict
[
pid
]
=
value
or
''
prop_dict
[
pid
]
=
value
.
decode
(
'utf-8'
)
if
value
else
''
elif
prop_type
in
(
'int'
,
'boolean'
):
prop_dict
[
pid
]
=
value
or
0
elif
prop_type
in
(
'lines'
,
'tokens'
):
prop_dict
[
pid
[:
-
5
]]
=
(
value
or
''
).
splitlines
()
prop_dict
[
pid
[:
-
5
]]
=
(
value
.
decode
(
'utf-8'
)
if
value
else
''
).
splitlines
()
self
.
_edit
(
**
prop_dict
)
try
:
...
...
product/ERP5Type/Tool/WorkflowTool.py
View file @
326a1655
...
...
@@ -53,7 +53,7 @@ SECURITY_PARAMETER_ID = 'local_roles'
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
ModuleSecurityInfo
(
__name__
).
declarePublic
(
'SECURITY_PARAMETER_ID'
)
class
WorkflowTool
(
BaseTool
,
OriginalWorkflowTool
):
class
WorkflowTool
(
BaseTool
):
"""
A new container for DC workflow and workflow;
inherits methods from original WorkflowTool.py;
...
...
@@ -75,6 +75,21 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
'DublinCore'
,
)
def
_isBootstrapRequired
(
self
):
"""
Required by synchronizeDynamicModules() to bootstrap an empty site and
thus create portal_components
"""
return
False
def
_bootstrap
(
self
):
"""
Required by synchronizeDynamicModules() to bootstrap an empty site and
thus create portal_components
"""
pass
def
filtered_meta_types
(
self
,
user
=
None
):
return
False
...
...
product/ERP5Type/dynamic/component_package.py
View file @
326a1655
...
...
@@ -421,10 +421,11 @@ class ComponentDynamicPackage(ModuleType):
# load_module(), and returning module 'name' in contrary to __import__
# returning 'erp5' (requiring fromlist parameter which is slower)
return
import_module
(
fullname
)
except
ModuleNotFoundError
:
# >= 3.6
pass
except
ImportError
as
e
:
if
str
(
e
)
!=
"No module named "
+
name
:
LOG
(
"ERP5Type.dynamic"
,
WARNING
,
"Could not load Component module %r"
%
fullname
,
error
=
True
)
LOG
(
"ERP5Type.dynamic"
,
WARNING
,
"Could not load Component module %r"
%
fullname
,
error
=
True
)
return
None
...
...
product/ERP5Type/patches/ppml.py
View file @
326a1655
...
...
@@ -83,7 +83,7 @@ def unconvert(encoding,S):
if
encoding
==
'base64'
:
return
base64
.
decodestring
(
S
)
else
:
return
eval
(
"'"
+
S
.
replace
(
'
\
n
'
,
''
)
+
"'"
)
return
bytes
(
eval
(
b"'"
+
S
.
replace
(
b'
\
n
'
,
b''
)
+
b"'"
),
'utf-8'
)
ppml
.
unconvert
=
unconvert
...
...
@@ -671,31 +671,28 @@ class ToXMLUnpickler(Unpickler):
ppml
.
ToXMLUnpickler
=
ToXMLUnpickler
def
save_string
(
self
,
tag
,
data
):
binary
=
self
.
binary
v
=
''
a
=
data
[
1
]
if
len
(
data
)
>
2
:
v
=
''
.
join
(
data
[
2
:])
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
# JPS: repr is default encoding
a
=
data
[
1
]
v
=
b''
.
join
(
data
[
2
:])
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
# JPS: repr is default encoding
if
encoding
is
not
''
:
v
=
unconvert
(
encoding
,
v
)
put
=
'p'
if
binary
:
l
=
len
(
v
)
s
=
mdumps
(
l
)[
1
:]
if
(
l
<
256
):
v
=
'U'
+
s
[
0
]
+
v
v
=
unconvert
(
encoding
,
v
)
if
self
.
binary
:
l
=
len
(
v
)
if
l
<
256
:
if
isinstance
(
v
,
str
):
import
pdb
;
pdb
.
set_trace
()
v
=
SHORT_BINSTRING
+
bytes
([
l
])
+
v
else
:
v
=
'T'
+
s
+
v
put
=
'q'
else
:
v
=
"S'"
+
v
+
"'
\
012
"
v
=
BINSTRING
+
struct
.
pack
(
'<i'
,
l
)
+
v
else
:
v
=
STRING
+
repr
(
v
)
+
'
\
n
'
return
save_put
(
self
,
v
,
a
)
ppml
.
save_string
=
save_string
def
save_unicode
(
self
,
tag
,
data
):
binary
=
self
.
binary
v
=
''
v
=
b
''
a
=
data
[
1
]
if
len
(
data
)
>
2
:
for
x
in
data
[
2
:]:
...
...
@@ -715,20 +712,20 @@ ppml.save_unicode = save_unicode
def
save_object
(
self
,
tag
,
data
):
if
len
(
data
)
==
5
:
#OBJECT
v
=
'('
+
data
[
2
]
v
=
b
'('
+
data
[
2
]
x
=
data
[
3
][
1
:]
stop
=
x
.
rfind
(
't'
)
# This seems
stop
=
x
.
rfind
(
b
't'
)
# This seems
if
stop
>=
0
:
x
=
x
[:
stop
]
# wrong!
v
=
save_put
(
self
,
v
+
x
+
'o'
,
data
[
1
])
v
=
v
+
data
[
4
]
+
'b'
# state
v
=
save_put
(
self
,
v
+
x
+
b
'o'
,
data
[
1
])
v
=
v
+
data
[
4
]
+
b
'b'
# state
return
v
else
:
#REDUCE
#data does not contain state.(See Object.__setstate__ definition)
#So, we can assume that this is a reduce. (Yusei)
v
=
'('
+
data
[
2
]
v
=
b
'('
+
data
[
2
]
v
=
save_put
(
self
,
data
[
2
]
+
data
[
3
],
data
[
1
])
v
=
v
+
'R'
v
=
v
+
b
'R'
return
v
ppml
.
save_object
=
save_object
...
...
@@ -737,16 +734,16 @@ def save_pickle_start(self, tag, attrs):
return
[
tag
,
attrs
]
def
save_pickle
(
self
,
tag
,
data
):
return
data
[
2
]
+
'.'
return
data
[
2
]
+
b
'.'
def
save_none
(
self
,
tag
,
data
):
return
'N'
return
b
'N'
def
save_long
(
self
,
tag
,
data
):
return
'L'
+
data
[
2
]
+
'L
\
012
'
return
b'L'
+
data
[
2
]
+
b
'L
\
012
'
def
save_item
(
self
,
tag
,
data
):
return
''
.
join
(
data
[
2
:])
return
b
''
.
join
(
data
[
2
:])
def
save_value
(
self
,
tag
,
data
):
return
data
[
2
]
...
...
@@ -819,7 +816,7 @@ def importXML(jar, file, clue=''):
# So we have to declare an encoding but not use unicode, so the unpickler
# can deal with the utf-8 strings directly
p
=
xml
.
parsers
.
expat
.
ParserCreate
(
'utf-8'
)
p
.
returns_unicode
=
False
#
p.returns_unicode = False
# </patch>
p
.
CharacterDataHandler
=
F
.
handle_data
p
.
StartElementHandler
=
F
.
unknown_starttag
...
...
product/ZMySQLDA/db.py
View file @
326a1655
...
...
@@ -457,7 +457,7 @@ class DB(TM):
return
items
,
result
def
string_literal
(
self
,
s
):
return
self
.
db
.
string_literal
(
s
)
return
self
.
db
.
string_literal
(
s
)
.
decode
(
'utf-8'
)
def
_begin
(
self
,
*
ignored
):
"""Begin a transaction (when TM is enabled)."""
...
...
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