Remove nbsp in comments and documentation
This commit is contained in:
parent
44190f3f29
commit
c79dcc22df
5 changed files with 16 additions and 16 deletions
|
|
@ -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 <weboob.capabilities.base.NotLoaded>`, and when the backend loads them, it replaces them with
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue