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):
class CDNBasePage(HTMLPage):
def get_from_js(self, pattern, end_pattern, is_list=False):
"""
find a pattern in any javascript text
"""
for script in self.doc.xpath('//script'):
txt = script.text
if txt is None:
continue
start = txt.find(pattern)
if start < 0:
continue
values = []
while start >= 0:
start += len(pattern)
end = txt.find(end_pattern, start)
values.append(txt[start:end])
if not is_list:
break
start = txt.find(pattern, end)
return ','.join(values)
def get_execution(self):
return self.get_from_js("name: 'execution', value: '", "'")
def iban_go(self):
return '%s%s' % ('/vos-comptes/IPT/cdnProxyResource', self.get_from_js('C_PROXY.StaticResourceClientTranslation( "', '"'))
def get_from_js(self, pattern, end_pattern, is_list=False):
"""
find a pattern in any javascript text
"""
for script in self.doc.xpath('//script'):
txt = script.text
if txt is None:
continue
start = txt.find(pattern)
if start < 0:
continue
values = []
while start >= 0:
start += len(pattern)
end = txt.find(end_pattern, start)
values.append(txt[start:end])
if not is_list:
break
start = txt.find(pattern, end)
return ','.join(values)
def get_execution(self):
return self.get_from_js("name: 'execution', value: '", "'")
def iban_go(self):
return '%s%s' % ('/vos-comptes/IPT/cdnProxyResource', self.get_from_js('C_PROXY.StaticResourceClientTranslation( "', '"'))
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