From c79dcc22df43c3ac2685e5e81ab96a7e85302bb4 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Sat, 11 Oct 2014 18:48:33 +0200 Subject: [PATCH] Remove nbsp in comments and documentation --- docs/source/guides/capability.rst | 2 +- modules/champslibres/pages.py | 2 +- modules/freemobile/pages/login.py | 10 +++++----- modules/gdfsuez/pages/history.py | 12 ++++++------ modules/leclercmobile/pages/history.py | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/source/guides/capability.rst b/docs/source/guides/capability.rst index 3aa29b2c..37d38a5d 100644 --- a/docs/source/guides/capability.rst +++ b/docs/source/guides/capability.rst @@ -27,7 +27,7 @@ When an object is fetched, all of its fields are not necessarily loaded. For example, on a video search, if the *backend* gets information from the search page, the direct URL of the video isn't available yet. -A field which isn't loaded can be set to :class:`weboob.capabilities.base.NotLoaded`. +A field which isn't loaded can be set to :class:`weboob.capabilities.base.NotLoaded`. By default, in the object constructor, every fields should be set to :class:`NotLoaded `, and when the backend loads them, it replaces them with diff --git a/modules/champslibres/pages.py b/modules/champslibres/pages.py index 25fd10b7..1ec76fe1 100644 --- a/modules/champslibres/pages.py +++ b/modules/champslibres/pages.py @@ -55,7 +55,7 @@ class RentedPage(Page): yield book def renew(self, id): - # find the good box + # find the good box input = self.document.find('//input[@value="%s"]' % id) self.browser.select_form("checkout_form") self.browser.form.set_all_readonly(False) diff --git a/modules/freemobile/pages/login.py b/modules/freemobile/pages/login.py index 8aa04c6c..8a61f9fd 100644 --- a/modules/freemobile/pages/login.py +++ b/modules/freemobile/pages/login.py @@ -47,11 +47,11 @@ class FreeKeyboard(object): img = Image.open(imgfile) matrix = img.load() s = "" - # The digit is only displayed in the center of image + # The digit is only displayed in the center of image for x in range(15, 23): for y in range(12, 27): (r, g, b) = matrix[x, y] - # If the pixel is "red" enough + # If the pixel is "red" enough if g + b < 450: s += "1" else: @@ -64,9 +64,9 @@ class FreeKeyboard(object): for i, string in enumerate(self.fingerprints): if string == fingerprint: return i - # Image contains some noise, and the match is not always perfect - # (this is why we can't use md5 hashs) - # But if we can't find the perfect one, we can take the best one + # Image contains some noise, and the match is not always perfect + # (this is why we can't use md5 hashs) + # But if we can't find the perfect one, we can take the best one best = 0 result = None for i, string in enumerate(self.fingerprints): diff --git a/modules/gdfsuez/pages/history.py b/modules/gdfsuez/pages/history.py index fe315251..30533182 100644 --- a/modules/gdfsuez/pages/history.py +++ b/modules/gdfsuez/pages/history.py @@ -132,7 +132,7 @@ class PdfPage(): # Things for which we want a new detail else: # Entering here, we will instantiate a new detail. - # We hadn't so before because of fragmented lines. + # We hadn't so before because of fragmented lines. if detail is not None and detail.label is not NotAvailable: # We have a new element, return the other one details.append(detail) @@ -140,8 +140,8 @@ class PdfPage(): detail.price = Decimal(0) # If the coma is not a decimal separator, then - # this is is probably a loooong sentence. - # When it comes to jokes, keep it short and sweet. + # this is is probably a loooong sentence. + # When it comes to jokes, keep it short and sweet. line = re.split(textwithcoma, line)[0] # Things we want for sure @@ -154,7 +154,7 @@ class PdfPage(): label = mylist[0] + mylist[1] detail.label = unicode(label, encoding='utf-8') elif re.findall(endwithdigit, line): - # What is this stupid number at the end of the line? + # What is this stupid number at the end of the line? # Line should have been split before the number detail.label = unicode(re.split(endwithdigit, line)[0], encoding='utf-8') # Things we don't want for sure @@ -171,7 +171,7 @@ class PdfPage(): # '00,00 € HT par mois' may have been split after HT # We don't need of the second line detail.label = NotAvailable - # Things we probably want to keep + # Things we probably want to keep else: # Well, maybe our line is correct, after all. # Not much to do. @@ -192,7 +192,7 @@ class PdfPage(): label = detail.label.split(' au ')[0] + u' au ' + unicode(line, encoding='utf-8') detail.label = label if detail.label is not NotAvailable: - # Do not append empty details to the list + # Do not append empty details to the list # It seemed easier to create details anyway than dealing # with None objects details.append(detail) diff --git a/modules/leclercmobile/pages/history.py b/modules/leclercmobile/pages/history.py index 5e3f0d1d..a51f5486 100644 --- a/modules/leclercmobile/pages/history.py +++ b/modules/leclercmobile/pages/history.py @@ -91,10 +91,10 @@ class PdfPage(): return details # Standard pdf text extractor take text line by line - # But the position in the file is not always the "real" position to display... + # But the position in the file is not always the "real" position to display... # It produce some unsorted and unparsable data - # Example of bad software: pdfminer and others python tools - # This is why we have to use "ebook-convert" from calibre software, + # Example of bad software: pdfminer and others python tools + # This is why we have to use "ebook-convert" from calibre software, # it is the only one to 'reflow" text and give some relevant results # The bad new is that ebook-convert doesn't support simple use with stdin/stdout def get_calls(self):