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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
063c141a
Commit
063c141a
authored
Apr 24, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: fix warnings with regex
parent
9c8624b1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
product/ERP5Form/Tool/SelectionTool.py
product/ERP5Form/Tool/SelectionTool.py
+1
-1
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+1
-1
product/ERP5Type/Utils.py
product/ERP5Type/Utils.py
+4
-4
product/Formulator/Validator.py
product/Formulator/Validator.py
+1
-1
No files found.
product/ERP5Form/Tool/SelectionTool.py
View file @
063c141a
...
@@ -684,7 +684,7 @@ class SelectionTool( BaseTool, SimpleItem ):
...
@@ -684,7 +684,7 @@ class SelectionTool( BaseTool, SimpleItem ):
# qdsqdsq/Base_view/qsdsqd --> matches
# qdsqdsq/Base_view/qsdsqd --> matches
# qdsqdsq/Base_viewAaa --> doesn't match
# qdsqdsq/Base_viewAaa --> doesn't match
# qdsqdsq/Umpa_view --> doesn't match
# qdsqdsq/Umpa_view --> doesn't match
if
re
.
search
(
'/%s($|
\
W+)
'
% form_id, url):
if
re
.
search
(
r
'/%s($|\
W+)
' % form_id, url):
return form_id
return form_id
return '
view
'
return '
view
'
...
...
product/ERP5Type/Base.py
View file @
063c141a
...
@@ -128,7 +128,7 @@ class PersistentContainer(Persistent):
...
@@ -128,7 +128,7 @@ class PersistentContainer(Persistent):
self
.
value
=
state
self
.
value
=
state
global
registered_workflow_method_set
global
registered_workflow_method_set
wildcard_interaction_method_id_match
=
re
.
compile
(
r'[[.?*+{(\\]'
).
search
wildcard_interaction_method_id_match
=
re
.
compile
(
r'[
\
[.?*+{(
\\
]
').search
workflow_method_registry = [] # XXX A set() would be better but would require a hash in WorkflowMethod class
workflow_method_registry = [] # XXX A set() would be better but would require a hash in WorkflowMethod class
def resetRegisteredWorkflowMethod(portal_type=None):
def resetRegisteredWorkflowMethod(portal_type=None):
...
...
product/ERP5Type/Utils.py
View file @
063c141a
...
@@ -770,7 +770,7 @@ from .Accessor.Base import func_code
...
@@ -770,7 +770,7 @@ from .Accessor.Base import func_code
from
Products.CMFCore.utils
import
manage_addContentForm
,
manage_addContent
from
Products.CMFCore.utils
import
manage_addContentForm
,
manage_addContent
from
AccessControl.PermissionRole
import
PermissionRole
from
AccessControl.PermissionRole
import
PermissionRole
python_file_parser
=
re
.
compile
(
'^(.*)
\
.py$
'
)
python_file_parser
=
re
.
compile
(
r
'^(.*)\
.py$
')
def getLocalPropertySheetList():
def getLocalPropertySheetList():
if not getConfiguration:
if not getConfiguration:
...
@@ -1748,12 +1748,12 @@ from six.moves.urllib.parse import urlsplit, urlunsplit, urljoin
...
@@ -1748,12 +1748,12 @@ from six.moves.urllib.parse import urlsplit, urlunsplit, urljoin
# Regular expressions
# Regular expressions
re_cleanup_anchors
=
re
.
compile
(
'#.*'
)
re_cleanup_anchors
=
re
.
compile
(
'#.*'
)
re_extract_port
=
re
.
compile
(
':(
\
d+)$
'
)
re_extract_port
=
re
.
compile
(
r
':(\
d+)$
')
def uppercaseLetter(matchobject):
def uppercaseLetter(matchobject):
return matchobject.group(0).upper()
return matchobject.group(0).upper()
re_cleanup_escaped_url = re.compile('
%
\
w
\
d
')
re_cleanup_escaped_url = re.compile(
r
'
%
\
w
\
d
')
re_cleanup_slashes = re.compile('
/
{
2
,}
')
re_cleanup_slashes = re.compile('
/
{
2
,}
')
re_cleanup_tail = re.compile('
\
??$
')
re_cleanup_tail = re.compile(
r
'
\
??$
')
def legacyNormalizeUrl(url, base_url=None):
def legacyNormalizeUrl(url, base_url=None):
"""this method does normalisation itself.
"""this method does normalisation itself.
...
...
product/Formulator/Validator.py
View file @
063c141a
...
@@ -184,7 +184,7 @@ class EmailValidator(StringValidator):
...
@@ -184,7 +184,7 @@ class EmailValidator(StringValidator):
# brackets around the address (we assume these would be added by
# brackets around the address (we assume these would be added by
# some custom script if needed), and of course no characters that
# some custom script if needed), and of course no characters that
# don't belong in an e-mail address.
# don't belong in an e-mail address.
pattern
=
re
.
compile
(
'^[0-9a-zA-Z_
\
'
&.%+-]+@([0-9a-zA-Z]([0-9a-zA-Z-]*[0-9a-zA-Z])?
\
.)+[
a
-zA-Z]{2,}$'
)
pattern
=
re
.
compile
(
r
'^[0-9a-zA-Z_\'&.%+-]+@([0-9a-zA-Z]([0-9a-zA-Z-]*[0-9a-zA-Z])?\
.)+[
a-zA-Z]{2,}$'
)
def
validate
(
self
,
field
,
key
,
REQUEST
):
def
validate
(
self
,
field
,
key
,
REQUEST
):
value
=
StringValidator
.
validate
(
self
,
field
,
key
,
REQUEST
)
value
=
StringValidator
.
validate
(
self
,
field
,
key
,
REQUEST
)
...
...
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