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
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
080dafd0
Commit
080dafd0
authored
Dec 17, 2019
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: Preparation of erp5_base migration from FS: Fix pylint warning on regexp strings.
parent
657caeb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
32 deletions
+32
-32
product/ERP5/Document/Telephone.py
product/ERP5/Document/Telephone.py
+30
-30
product/ERP5OOo/Document/OOoDocument.py
product/ERP5OOo/Document/OOoDocument.py
+2
-2
No files found.
product/ERP5/Document/Telephone.py
View file @
080dafd0
...
@@ -66,57 +66,57 @@ class Telephone(Coordinate):
...
@@ -66,57 +66,57 @@ class Telephone(Coordinate):
# be carefull to add a new regex.
# be carefull to add a new regex.
regex_list
=
[
regex_list
=
[
# Country, Area, City, Number, Extension*
# Country, Area, City, Number, Extension*
"
\
+(?P<cou
n
try>[
\
d ]+)(
\
(0
\
)|
\
|
\
-)(?P<
a
rea>
\
d+)(
\
-|
\
)(?P<ci
t
y>
\
d+)(
\
-|
\
)(?P<
n
umber>[
\
d
\
\
-]*)(?:
\
/)?(?P<ext>
\
d+|)
"
,
r
"\
+(?P<cou
ntry>[\
d ]+)(
\(0\
)|
\ |\
-)(?P<
area>\
d+)(
\-|\
)(?P<ci
ty>\
d+)(
\-|\
)(?P<
number>[\
d
\ \
-]*)(?:
\/)?(?P<ext>\
d+|)
",
# Area, City, Number, Extension*
# Area, City, Number, Extension*
"
^
(
\
(
0
\
)
|
0
)
?
(
?
P
<
area
>
\
d
+
)(
\
-|
\
|
\
/
)(
?
P
<
city
>
\
d
+
)(
\
-|
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
^
(
\
(
0
\
)
|
0
)
?
(
?
P
<
area
>
\
d
+
)(
\
-|
\
|
\
/
)(
?
P
<
city
>
\
d
+
)(
\
-|
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
"
^
\
+
(
\
(
0
\
)
|
0
)
+
(
?
P
<
area
>
\
d
+
)(
\
-|
\
|
\
/
)(
?
P
<
city
>
\
d
+
)(
\
-|
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
^
\
+
(
\
(
0
\
)
|
0
)
+
(
?
P
<
area
>
\
d
+
)(
\
-|
\
|
\
/
)(
?
P
<
city
>
\
d
+
)(
\
-|
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, Area, Number, Extension*
# Country, Area, Number, Extension*
# +11(0)1-11111111/111 or +11(0)1-11111111/ or +11(0)1-11111111
# +11(0)1-11111111/111 or +11(0)1-11111111/ or +11(0)1-11111111
# +11(0)1-1111-1111/111 or +11(0)1-1111-1111/ or +11(0)1-1111-1111
# +11(0)1-1111-1111/111 or +11(0)1-1111-1111/ or +11(0)1-1111-1111
# + 11 (0)1-11 11 01 01/111 or + 11 (0)1-11 11 01 01/ or + 11 (0)1-11 11 01 01
# + 11 (0)1-11 11 01 01/111 or + 11 (0)1-11 11 01 01/ or + 11 (0)1-11 11 01 01
# +11 (0)11 1011 1100/111 or +11 (0)11 1011 1100/ or +11 (0)11 1011 1100
# +11 (0)11 1011 1100/111 or +11 (0)11 1011 1100/ or +11 (0)11 1011 1100
"
\
+
(
?
P
<
country
>
[
\
d
\
]
*
)
\
(
0
\
)(
?
P
<
area
>
\
d
+
)(
\
-|
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
[
\
d
\
]
*
)
\
(
0
\
)(
?
P
<
area
>
\
d
+
)(
\
-|
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, Area, Number, Extension*
# Country, Area, Number, Extension*
# +11-1-11111111/111 or +11-1-11111111/ or +11-1-11111111
# +11-1-11111111/111 or +11-1-11111111/ or +11-1-11111111
"
\
+
(
?
P
<
country
>
\
d
+
)
-
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
-
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Missing area
# Missing area
# +11(0)-11111111/111"
or
+
11
(
0
)
-
11111111
/
or
+
11
(
0
)
-
11111111
# +11(0)-11111111/111"
or
+
11
(
0
)
-
11111111
/
or
+
11
(
0
)
-
11111111
"
\
+(?P<cou
n
try>
\
d+)
\
(0
\
)
\
-(?P<number>[
\
d
\
]*)(?:
\
/)?(?P<ex
t
>
\
d+|)
"
,
r
"\
+(?P<cou
ntry>\
d+)
\(0\
)
\-(?P<number>[\
d
\ ]*)(?:\
/)?(?P<ex
t>\
d+|)
",
# Country, Area, Number, Extension*
# Country, Area, Number, Extension*
# +11(1)11111111/111 or +11(1)11111111/ or +11(1)11111111
# +11(1)11111111/111 or +11(1)11111111/ or +11(1)11111111
"
\
+
(
?
P
<
country
>
\
d
+
)
\
((
?
P
<
area
>
\
d
+
)
\
)(
?
P
<
number
>
[
\
d
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
\
((
?
P
<
area
>
\
d
+
)
\
)(
?
P
<
number
>
[
\
d
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, Area, Number, Extension*
# Country, Area, Number, Extension*
# +111-1-11111111/111 or +111-1-11111111/ or +111-1-11111111
# +111-1-11111111/111 or +111-1-11111111/ or +111-1-11111111
"
\
+
(
?
P
<
country
>
\
d
+
)
-
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
-
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Missing country
# Missing country
# +(0)1-11111111/111"
or
+
(
0
)
1
-
11111111
/
or
+
(
0
)
1
-
11111111
# +(0)1-11111111/111"
or
+
(
0
)
1
-
11111111
/
or
+
(
0
)
1
-
11111111
"
\
+
\
(0
\
)(?P<
a
rea>
\
d+)
\
-(?P<number>[
\
d
\
]*)(?:
\
/)?(?P<ex
t
>
\
d+|)
"
,
r
"\
+
\(0\
)(?P<
area>\
d+)
\-(?P<number>[\
d
\ ]*)(?:\
/)?(?P<ex
t>\
d+|)
",
# Missing Country and Area
# Missing Country and Area
# +(0)-11111111/111"
or
+
(
0
)
-
11111111
/
or
+
(
0
)
-
11111111
# +(0)-11111111/111"
or
+
(
0
)
-
11111111
/
or
+
(
0
)
-
11111111
"
\
+
\
(0
\
)
\
-(?P<number>[
\
d
\
]*)(?:
\
/)?(?P<ex
t
>
\
d+|)
"
,
r
"\
+
\(0\
)
\-(?P<number>[\
d
\ ]*)(?:\
/)?(?P<ex
t>\
d+|)
",
# Area, Number Extension*
# Area, Number Extension*
# Area between parenthesis.
# Area between parenthesis.
# (11)11111111/111 or (11)11111111/ or (11)11111111
# (11)11111111/111 or (11)11111111/ or (11)11111111
"
\
((
?
P
<
area
>
\
d
+
)
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
((
?
P
<
area
>
\
d
+
)
\
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Missing country
# Missing country
# +(1)11111111/111"
or
+
(
1
)
11111111
/
or
+
(
1
)
11111111
# +(1)11111111/111"
or
+
(
1
)
11111111
/
or
+
(
1
)
11111111
"
\
+
\
((?P<area>
\
d+)
\
)(?P<number>[
\
d
\
\
-]*)(?:
\
/)?(?P<ext>
\
d+|)
"
,
r
"\
+
\((?P<area>\
d+)
\)(?P<number>[\
d
\ \
-]*)(?:
\/)?(?P<ext>\
d+|)
",
# Country, Area, Number and Extension*
# Country, Area, Number and Extension*
# Country space area space number slash extension or not
# Country space area space number slash extension or not
# +11 1 011111111/1 or +11 1 011111111/ or +11 1 011111111
# +11 1 011111111/1 or +11 1 011111111/ or +11 1 011111111
# + 111 1 1101 101/111 or + 111 1 1101 101/ or + 111 1 1101 101/111
# + 111 1 1101 101/111 or + 111 1 1101 101/ or + 111 1 1101 101/111
"
\
+
(
?
P
<
space
>
[
\
]
*
)(
?
P
<
country
>
\
d
+
)
\
(
?
P
<
area
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
space
>
[
\
]
*
)(
?
P
<
country
>
\
d
+
)
\
(
?
P
<
area
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# This regex is to handle two inputs very similar
# This regex is to handle two inputs very similar
# but with different behavior
# but with different behavior
...
@@ -125,7 +125,7 @@ class Telephone(Coordinate):
...
@@ -125,7 +125,7 @@ class Telephone(Coordinate):
#
#
# 111-11 11/111 or 111-11 11 or 111-11 11
# 111-11 11/111 or 111-11 11 or 111-11 11
# will result in {'area':'111', 'number':'11 11', 'ext':'111 or empty'}
# will result in {'area':'111', 'number':'11 11', 'ext':'111 or empty'}
"
^
(
?
:
0
)
?
((
?
P
<
area
>
\
d
+
)
-
)
?
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
r
"
^
(
?
:
0
)
?
((
?
P
<
area
>
\
d
+
)
-
)
?
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# Area, Number, Extension*
# Area, Number, Extension*
# It is a common input in France
# It is a common input in France
...
@@ -138,7 +138,7 @@ class Telephone(Coordinate):
...
@@ -138,7 +138,7 @@ class Telephone(Coordinate):
# so we have here two regex:
# so we have here two regex:
# To France: "
^
0
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# To France: "
^
0
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# To Japan: "
^
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# To Japan: "
^
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
"
^
0
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
r
"
^
0
(
?
P
<
area
>
\
d
+
)
-
(
?
P
<
number
>
[
\
d
\
-
\
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# Area, Number, Extension*
# Area, Number, Extension*
# It is a common input in France and in Japan but with different behavior.
# It is a common input in France and in Japan but with different behavior.
...
@@ -152,78 +152,78 @@ class Telephone(Coordinate):
...
@@ -152,78 +152,78 @@ class Telephone(Coordinate):
# "
^
0
(
?
P
<
area
>
\
d
+
)
\
((
?
P
<
number
>
[
\
d
\
)
\
(
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# "
^
0
(
?
P
<
area
>
\
d
+
)
\
((
?
P
<
number
>
[
\
d
\
)
\
(
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
#To Japan:
#To Japan:
# "
^
(
?
P
<
area
>
\
d
+
)
\
((
?
P
<
number
>
[
\
d
\
)
\
(
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# "
^
(
?
P
<
area
>
\
d
+
)
\
((
?
P
<
number
>
[
\
d
\
)
\
(
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
"
^
0
(
?
P
<
area
>
\
d
+
)
\
((
?
P
<
number
>
[
\
d
\
)
\
(
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
r
"
^
0
(
?
P
<
area
>
\
d
+
)
\
((
?
P
<
number
>
[
\
d
\
)
\
(
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
$
",
# Missing area
# Missing area
# +11()11111111/111"
or
+
11
()
11111111
/
or
+
11
()
11111111
# +11()11111111/111"
or
+
11
()
11111111
/
or
+
11
()
11111111
"
\
+(?P<cou
n
try>
\
d+)
\
(
\
)(?P<
n
umber>[
\
d
\
\
-]*)(?:
\
/)?(?P<ext>
\
d+|)
"
,
r
"\
+(?P<cou
ntry>\
d+)
\(\
)(?P<
number>[\
d
\ \
-]*)(?:
\/)?(?P<ext>\
d+|)
",
# Country, area, number, extension*
# Country, area, number, extension*
# Space between country and (0).
# Space between country and (0).
# Space between (0) and area.
# Space between (0) and area.
# Space between area and number.
# Space between area and number.
# +111 (0) 1 111 11011/111 or +111 (0) 1 111 11011/ or +111 (0) 1 111 11011
# +111 (0) 1 111 11011/111 or +111 (0) 1 111 11011/ or +111 (0) 1 111 11011
"
\
+
(
?
P
<
country
>
\
d
+
)
\ \
(
0
\
)
\
(
?
P
<
area
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
\ \
(
0
\
)
\
(
?
P
<
area
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country and number
# Country and number
# (0) between country and number
# (0) between country and number
# +111 (0) 111111101-01/111 or +111 (0) 111111101-01/ or +111 (0) 111111101-01
# +111 (0) 111111101-01/111 or +111 (0) 111111101-01/ or +111 (0) 111111101-01
"
\
+
(
?
P
<
country
>
\
d
+
)
\ \
(
0
\
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
\ \
(
0
\
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, area, number and extension*
# Country, area, number and extension*
# +11 (11) 1111 1111/111 or +11 (11) 1111 1111/ or +11 (11) 1111 1111
# +11 (11) 1111 1111/111 or +11 (11) 1111 1111/ or +11 (11) 1111 1111
# +11 (11)-10111111/111 or +11 (11)-10111111/ or +11 (11)-10111111
# +11 (11)-10111111/111 or +11 (11)-10111111/ or +11 (11)-10111111
# +11(11)-10111111/111 or +11(11)-10111111/ or +11(11)-10111111
# +11(11)-10111111/111 or +11(11)-10111111/ or +11(11)-10111111
# 1 (111) 1101-101/111 or 1 (111) 1101-101/ or 1 (111) 1101-101/
# 1 (111) 1101-101/111 or 1 (111) 1101-101/ or 1 (111) 1101-101/
"
(
\
+|
)(
?
P
<
country
>
\
d
+
)
\ \
((
?
P
<
area
>
\
d
+
)
\
)(
\
|
\
-|
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
(
\
+|
)(
?
P
<
country
>
\
d
+
)
\ \
((
?
P
<
area
>
\
d
+
)
\
)(
\
|
\
-|
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# +110 1111111/111 or +110 1111111/ or +110 1111111
# +110 1111111/111 or +110 1111111/ or +110 1111111
"
\
+
(
?
P
<
country
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Missing country
# Missing country
# 111/111-1111/111 or 111/111-1111/ or 111/111-1111
# 111/111-1111/111 or 111/111-1111/ or 111/111-1111
"
(
?
P
<
area
>
\
d
+
)
\
/
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
(
?
P
<
area
>
\
d
+
)
\
/
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, area, number, extension*
# Country, area, number, extension*
# Hyphen between country and area.
# Hyphen between country and area.
# +11-1 11 11 01 11/111 or +11-1 11 11 01 11/ or +11-1 11 11 01 11
# +11-1 11 11 01 11/111 or +11-1 11 11 01 11/ or +11-1 11 11 01 11
"
\
+
(
?
P
<
country
>
\
d
+
)
\
-
(
?
P
<
area
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
\
-
(
?
P
<
area
>
\
d
+
)
\
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Missing area
# Missing area
# +111-1101110/111 or +111-1101110/ or +111-1101110
# +111-1101110/111 or +111-1101110/ or +111-1101110
"
\
+
(
?
P
<
country
>
\
d
+
)
\
-
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
country
>
\
d
+
)
\
-
(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Missing country
# Missing country
# Dot between area number and telephone number.
# Dot between area number and telephone number.
# 111.111.1111/111 or 111.111.1111/ or 111.111.1111
# 111.111.1111/111 or 111.111.1111/ or 111.111.1111
"
(
?
P
<
area
>
\
d
+
)
\
.(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
(
?
P
<
area
>
\
d
+
)
\
.(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, area, number and extensioin*
# Country, area, number and extensioin*
# (111 11) 111111/111 or (111 11) 111111/ or (111 11) 111111
# (111 11) 111111/111 or (111 11) 111111/ or (111 11) 111111
# (111 11) 111-11-11/111 or (111 11) 111-11-11/ or (111 11) 111-11-11
# (111 11) 111-11-11/111 or (111 11) 111-11-11/ or (111 11) 111-11-11
# (111 11)101011/111 or (111 11)101011/ or (111 11)101011
# (111 11)101011/111 or (111 11)101011/ or (111 11)101011
# +(111 11) 100-11-11/111 or +(111 11) 100-11-11 or +(111 11) 100-11-11
# +(111 11) 100-11-11/111 or +(111 11) 100-11-11 or +(111 11) 100-11-11
"
(
\
+|
)
\
((
?
P
<
country
>
\
d
+
)
\
(
?
P
<
area
>
\
d
+
)
\
)(
\
|
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
(
\
+|
)
\
((
?
P
<
country
>
\
d
+
)
\
(
?
P
<
area
>
\
d
+
)
\
)(
\
|
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country and number
# Country and number
# (+111)101111111/111 or (+111)101111111/ or (+111)101111111
# (+111)101111111/111 or (+111)101111111/ or (+111)101111111
# (+111) 101111111/111 or (+111) 101111111/ or (+111) 101111111
# (+111) 101111111/111 or (+111) 101111111/ or (+111) 101111111
"
\
(
\
+
(
?
P
<
country
>
\
d
+
)
\
)(
\
|
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
(
\
+
(
?
P
<
country
>
\
d
+
)
\
)(
\
|
)(
?
P
<
number
>
[
\
d
\ \
-
]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, area, number and extension*
# Country, area, number and extension*
# (+11-111) 1111111/111 or (+11-111) 1111111/ or (+11-111) 1111111
# (+11-111) 1111111/111 or (+11-111) 1111111/ or (+11-111) 1111111
# (11-11) 111-1111/111 or (11-11) 111-1111/ or (11-11) 111-1111
# (11-11) 111-1111/111 or (11-11) 111-1111/ or (11-11) 111-1111
# (11-1) 1.111.111/111 or (11-1) 1.111.111/ or (11-1) 1.111.111
# (11-1) 1.111.111/111 or (11-1) 1.111.111/ or (11-1) 1.111.111
"
\
((
\
+|
)(
?
P
<
country
>
\
d
+
)
\
-
(
?
P
<
area
>
\
d
+
)
\
)(
\
|
\
-|
)(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
((
\
+|
)(
?
P
<
country
>
\
d
+
)
\
-
(
?
P
<
area
>
\
d
+
)
\
)(
\
|
\
-|
)(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# Country, area, number and extension*
# Country, area, number and extension*
# + 111-11-1110111/111 or + 111-11-1110111/ or + 111-11-1110111
# + 111-11-1110111/111 or + 111-11-1110111/ or + 111-11-1110111
# +111-11-1110111/111 or +111-11-1110111/ or +111-11-1110111
# +111-11-1110111/111 or +111-11-1110111/ or +111-11-1110111
# +111/1/1111 1100/111 or +111/1/1111 1100/ or +111/1/1111 1100
# +111/1/1111 1100/111 or +111/1/1111 1100/ or +111/1/1111 1100
"
\
+
(
?
P
<
spaces
>
[
\
]
*
)(
?
P
<
country
>
\
d
+
)(
\
-|
\
/
)(
?
P
<
area
>
\
d
+
)(
\
-|
\
/
)(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
r
"
\
+
(
?
P
<
spaces
>
[
\
]
*
)(
?
P
<
country
>
\
d
+
)(
\
-|
\
/
)(
?
P
<
area
>
\
d
+
)(
\
-|
\
/
)(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
",
# + (111) 111-111/111 or + (111) 111-111/ or + (111) 111-111
# + (111) 111-111/111 or + (111) 111-111/ or + (111) 111-111
"
\
+
(
?
P
<
spaces
>
[
\
]
*
)
\
((
?
P
<
country
>
\
d
+
)
\
)
\
(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
"
r
"
\
+
(
?
P
<
spaces
>
[
\
]
*
)
\
((
?
P
<
country
>
\
d
+
)
\
)
\
(
?
P
<
number
>
[
\
d
\ \
-
\
.]
*
)(
?
:
\
/
)
?
(
?
P
<
ext
>
\
d
+|
)
"
]
]
compiled_regex_list = [re.compile(pattern) for pattern in regex_list]
compiled_regex_list = [re.compile(pattern) for pattern in regex_list]
...
...
product/ERP5OOo/Document/OOoDocument.py
View file @
080dafd0
...
@@ -117,8 +117,8 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
...
@@ -117,8 +117,8 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
)
)
# regular expressions for stripping xml from ODF documents
# regular expressions for stripping xml from ODF documents
rx_strip
=
re
.
compile
(
'<[^>]*?>'
,
re
.
DOTALL
|
re
.
MULTILINE
)
rx_strip
=
re
.
compile
(
r
'<[^>]*?>'
,
re
.
DOTALL
|
re
.
MULTILINE
)
rx_compr
=
re
.
compile
(
'
\
s+
'
)
rx_compr
=
re
.
compile
(
r
'\
s+
')
security.declareProtected(Permissions.View, '
index_html
')
security.declareProtected(Permissions.View, '
index_html
')
@fill_args_from_request('
display
', '
quality
', '
resolution
')
@fill_args_from_request('
display
', '
quality
', '
resolution
')
...
...
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