From 88df613a53e504393ed0376985051bc1db0f7334 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Fri, 21 Nov 2014 16:22:31 +0100 Subject: [PATCH] Fix English: "childs" into "children" refs #1675 --- modules/freemobile/pages/homepage.py | 2 +- modules/logicimmo/pages.py | 2 +- modules/okc/browser.py | 2 +- weboob/browser/filters/standard.py | 12 ++++++------ weboob/tools/application/repl.py | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/freemobile/pages/homepage.py b/modules/freemobile/pages/homepage.py index 5efe0854..8ad19f53 100644 --- a/modules/freemobile/pages/homepage.py +++ b/modules/freemobile/pages/homepage.py @@ -37,7 +37,7 @@ class HomePage(BadUTF8Page): class item(ItemElement): klass = Subscription - obj_subscriber = CleanText('div[@class="idAbonne pointer"]/p[1]', symbols='-', childs=False) + obj_subscriber = CleanText('div[@class="idAbonne pointer"]/p[1]', symbols='-', children=False) obj_id = CleanText('div[@class="idAbonne pointer"]/p/span') obj__login = GetID(Attr('.//div[@class="acceuil_btn"]/a', 'href')) obj_label = Format(u'%s - %s', Field('id'), CleanText('//div[@class="forfaitChoisi"]')) diff --git a/modules/logicimmo/pages.py b/modules/logicimmo/pages.py index e19c313a..76e6173c 100644 --- a/modules/logicimmo/pages.py +++ b/modules/logicimmo/pages.py @@ -48,7 +48,7 @@ class CitiesPage(JsonPage): class PhonePage(HTMLPage): def get_phone(self): - return CleanText('//div[has-class("phone")]', childs=False)(self.doc) + return CleanText('//div[has-class("phone")]', children=False)(self.doc) class HousingPage(HTMLPage): diff --git a/modules/okc/browser.py b/modules/okc/browser.py index c86b6db2..9fe814f0 100644 --- a/modules/okc/browser.py +++ b/modules/okc/browser.py @@ -110,7 +110,7 @@ class OkCBrowser(Browser): # return r['result']['flashs'] #@check_login - #def nb_godchilds(self): + #def nb_godchildren(self): # r = self.api_request('member', 'view', data={'id': self.my_id}) # return int(r['result']['member']['popu']['invits']) diff --git a/weboob/browser/filters/standard.py b/weboob/browser/filters/standard.py index 9c08f6fc..e2e43934 100644 --- a/weboob/browser/filters/standard.py +++ b/weboob/browser/filters/standard.py @@ -317,29 +317,29 @@ class CleanText(Filter): u'coucou\\ncoucou' """ - def __init__(self, selector=None, symbols='', replace=[], childs=True, newlines=True, normalize='NFC', **kwargs): + def __init__(self, selector=None, symbols='', replace=[], children=True, newlines=True, normalize='NFC', **kwargs): super(CleanText, self).__init__(selector, **kwargs) self.symbols = symbols self.toreplace = replace - self.childs = childs + self.children = children self.newlines = newlines self.normalize = normalize @debug() def filter(self, txt): if isinstance(txt, (tuple, list)): - txt = u' '.join([self.clean(item, childs=self.childs) for item in txt]) + txt = u' '.join([self.clean(item, children=self.children) for item in txt]) - txt = self.clean(txt, self.childs, self.newlines, self.normalize) + txt = self.clean(txt, self.children, self.newlines, self.normalize) txt = self.remove(txt, self.symbols) txt = self.replace(txt, self.toreplace) # ensure it didn't become str by mistake return unicode(txt) @classmethod - def clean(cls, txt, childs=True, newlines=True, normalize='NFC'): + def clean(cls, txt, children=True, newlines=True, normalize='NFC'): if not isinstance(txt, basestring): - if childs: + if children: txt = [t.strip() for t in txt.itertext()] else: txt = [txt.text.strip()] diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index d7e86b4e..1b91364f 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -464,11 +464,11 @@ class ReplApplication(Cmd, ConsoleApplication): def path_completer(self, arg): dirname = os.path.dirname(arg) try: - childs = os.listdir(dirname or '.') + children = os.listdir(dirname or '.') except OSError: return () l = [] - for child in childs: + for child in children: path = os.path.join(dirname, child) if os.path.isdir(path): child += '/'