mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -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 = {}
|
||||
|
||||
def __init__(self, bytes, objects):
|
||||
self.stream = bytes if hasattr(bytes, 'read') else io.BytesIO(bytes)
|
||||
def __init__(self, byts, objects):
|
||||
self.stream = byts if hasattr(byts, 'read') else io.BytesIO(byts)
|
||||
length = self.stream_size()
|
||||
self.objects = objects
|
||||
self._contents = []
|
||||
|
@ -56,13 +56,13 @@ fields = {
|
||||
}
|
||||
|
||||
|
||||
def normalize(str):
|
||||
def normalize(s):
|
||||
"""
|
||||
The normalize-space function returns the argument string with whitespace
|
||||
normalized by stripping leading and trailing whitespace and replacing
|
||||
sequences of whitespace characters by a single space.
|
||||
"""
|
||||
return whitespace.sub(' ', str).strip()
|
||||
return whitespace.sub(' ', s).strip()
|
||||
|
||||
|
||||
class MetaCollector:
|
||||
@ -75,9 +75,9 @@ class MetaCollector:
|
||||
self._content = []
|
||||
self.dowrite = True
|
||||
|
||||
def write(self, str):
|
||||
def write(self, s):
|
||||
if self.dowrite:
|
||||
self._content.append(str)
|
||||
self._content.append(s)
|
||||
|
||||
def content(self):
|
||||
return ''.join(self._content)
|
||||
|
Loading…
x
Reference in New Issue
Block a user