Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
177
Issues
177
List
Boards
Labels
Milestones
Merge Requests
49
Merge Requests
49
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
6f8e573c
Commit
6f8e573c
authored
Jan 05, 2021
by
Florent Viard
Committed by
Vincent A
Jan 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lcl] Move get_phone_attributes into CheckValuesPage to be available for RecipConfirmPage
parent
58eff173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
modules/lcl/pages.py
modules/lcl/pages.py
+18
-18
No files found.
modules/lcl/pages.py
View file @
6f8e573c
...
...
@@ -1718,6 +1718,24 @@ class CheckValuesPage(HTMLPage):
elif
self
.
doc
.
xpath
(
'//script[contains(text(), "AuthentForteDesktop")]'
):
return
'app_validation'
def
get_phone_attributes
(
self
):
# The number which begin by 06 or 07 is not always referred as MOBILE number
# this function parse the html tag of the phone number which begins with 06 or 07
# to determine the canal attributed by the website, it can be MOBILE or FIXE
phone
=
{}
for
phone_tag
in
self
.
doc
.
xpath
(
'//div[@class="choixTel"]//div[@class="selectTel"]'
):
phone
[
'attr_id'
]
=
Attr
(
'.'
,
'id'
)(
phone_tag
)
phone
[
'number'
]
=
CleanText
(
'.//a[@id="fixIpad"]'
)(
phone_tag
)
if
phone
[
'number'
]
.
startswith
(
'06'
)
or
phone
[
'number'
]
.
startswith
(
'07'
):
# Let's take the first mobile phone
# If no mobile phone is available, we take last phone found (ex: 01)
break
assert
phone
[
'attr_id'
],
'no phone found for 2FA'
canal
=
re
.
match
(
'envoi(Fixe|Mobile)'
,
phone
[
'attr_id'
])
assert
canal
,
'Canal unknown
%
s'
%
phone
[
'attr_id'
]
phone
[
'attr_id'
]
=
canal
.
group
(
1
)
.
upper
()
return
phone
class
DocumentsPage
(
LoggedPage
,
HTMLPage
):
def
do_search_request
(
self
):
...
...
@@ -1790,24 +1808,6 @@ class TwoFAPage(CheckValuesPage):
default
=
None
)(
self
.
doc
)
def
get_phone_attributes
(
self
):
# The number which begin by 06 or 07 is not always referred as MOBILE number
# this function parse the html tag of the phone number which begins with 06 or 07
# to determine the canal attributed by the website, it can be MOBILE or FIXE
phone
=
{}
for
phone_tag
in
self
.
doc
.
xpath
(
'//div[@class="choixTel"]//div[@class="selectTel"]'
):
phone
[
'attr_id'
]
=
Attr
(
'.'
,
'id'
)(
phone_tag
)
phone
[
'number'
]
=
CleanText
(
'.//a[@id="fixIpad"]'
)(
phone_tag
)
if
phone
[
'number'
]
.
startswith
(
'06'
)
or
phone
[
'number'
]
.
startswith
(
'07'
):
# Let's take the first mobile phone
# If no mobile phone is available, we take last phone found (ex: 01)
break
assert
phone
[
'attr_id'
],
'no phone found for 2FA'
canal
=
re
.
match
(
'envoi(Fixe|Mobile)'
,
phone
[
'attr_id'
])
assert
canal
,
'Canal unknown
%
s'
%
phone
[
'attr_id'
]
phone
[
'attr_id'
]
=
canal
.
group
(
1
)
.
upper
()
return
phone
def
get_app_validation_msg
(
self
):
return
Coalesce
(
CleanText
(
'//form[@id="formNoSend"]//div[@id="polling"]//div[contains(text(), "application")]'
),
...
...
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