Commit 01f193c5 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[creditdunord] Re-indented whole CDNBasePage class

3 indentation spaces instead of 4
parent 14c05557
...@@ -189,36 +189,36 @@ class ProfilePage(LoggedPage, JsonPage): ...@@ -189,36 +189,36 @@ class ProfilePage(LoggedPage, JsonPage):
class CDNBasePage(HTMLPage): class CDNBasePage(HTMLPage):
def get_from_js(self, pattern, end_pattern, is_list=False): def get_from_js(self, pattern, end_pattern, is_list=False):
""" """
find a pattern in any javascript text find a pattern in any javascript text
""" """
for script in self.doc.xpath('//script'): for script in self.doc.xpath('//script'):
txt = script.text txt = script.text
if txt is None: if txt is None:
continue continue
start = txt.find(pattern) start = txt.find(pattern)
if start < 0: if start < 0:
continue continue
values = [] values = []
while start >= 0: while start >= 0:
start += len(pattern) start += len(pattern)
end = txt.find(end_pattern, start) end = txt.find(end_pattern, start)
values.append(txt[start:end]) values.append(txt[start:end])
if not is_list: if not is_list:
break break
start = txt.find(pattern, end) start = txt.find(pattern, end)
return ','.join(values) return ','.join(values)
def get_execution(self): def get_execution(self):
return self.get_from_js("name: 'execution', value: '", "'") return self.get_from_js("name: 'execution', value: '", "'")
def iban_go(self): def iban_go(self):
return '%s%s' % ('/vos-comptes/IPT/cdnProxyResource', self.get_from_js('C_PROXY.StaticResourceClientTranslation( "', '"')) return '%s%s' % ('/vos-comptes/IPT/cdnProxyResource', self.get_from_js('C_PROXY.StaticResourceClientTranslation( "', '"'))
class AccountsPage(LoggedPage, CDNBasePage): class AccountsPage(LoggedPage, CDNBasePage):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment