mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
do not shadow builtins as variable names
This commit is contained in:
parent
c18eb0cb8c
commit
824f909627
@ -97,8 +97,8 @@ class LRFContentObject(LRFObject):
|
|||||||
|
|
||||||
tag_map = {}
|
tag_map = {}
|
||||||
|
|
||||||
def __init__(self, bytes, objects):
|
def __init__(self, byts, objects):
|
||||||
self.stream = bytes if hasattr(bytes, 'read') else io.BytesIO(bytes)
|
self.stream = byts if hasattr(byts, 'read') else io.BytesIO(byts)
|
||||||
length = self.stream_size()
|
length = self.stream_size()
|
||||||
self.objects = objects
|
self.objects = objects
|
||||||
self._contents = []
|
self._contents = []
|
||||||
|
@ -56,13 +56,13 @@ fields = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def normalize(str):
|
def normalize(s):
|
||||||
"""
|
"""
|
||||||
The normalize-space function returns the argument string with whitespace
|
The normalize-space function returns the argument string with whitespace
|
||||||
normalized by stripping leading and trailing whitespace and replacing
|
normalized by stripping leading and trailing whitespace and replacing
|
||||||
sequences of whitespace characters by a single space.
|
sequences of whitespace characters by a single space.
|
||||||
"""
|
"""
|
||||||
return whitespace.sub(' ', str).strip()
|
return whitespace.sub(' ', s).strip()
|
||||||
|
|
||||||
|
|
||||||
class MetaCollector:
|
class MetaCollector:
|
||||||
@ -75,9 +75,9 @@ class MetaCollector:
|
|||||||
self._content = []
|
self._content = []
|
||||||
self.dowrite = True
|
self.dowrite = True
|
||||||
|
|
||||||
def write(self, str):
|
def write(self, s):
|
||||||
if self.dowrite:
|
if self.dowrite:
|
||||||
self._content.append(str)
|
self._content.append(s)
|
||||||
|
|
||||||
def content(self):
|
def content(self):
|
||||||
return ''.join(self._content)
|
return ''.join(self._content)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user