mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DRYer
This commit is contained in:
parent
61abe65c01
commit
1b2697a0d6
@ -567,8 +567,8 @@ class Worker(Thread): # Get details {{{
|
|||||||
filtered_characters = list(s for s in res if s.isprintable())
|
filtered_characters = list(s for s in res if s.isprintable())
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
filtered_characters = list(s for s in res if s in string.printable)
|
filtered_characters = list(s for s in res if s in string.printable)
|
||||||
res = ''.join(filtered_characters).strip()
|
res = ''.join(filtered_characters)
|
||||||
return res
|
return res.strip()
|
||||||
|
|
||||||
def parse_title(self, root):
|
def parse_title(self, root):
|
||||||
|
|
||||||
@ -1006,7 +1006,7 @@ class Worker(Thread): # Get details {{{
|
|||||||
|
|
||||||
def parse_detail_cells(self, mi, c1, c2):
|
def parse_detail_cells(self, mi, c1, c2):
|
||||||
name = self.totext(c1, only_printable=True).strip().strip(':').strip()
|
name = self.totext(c1, only_printable=True).strip().strip(':').strip()
|
||||||
val = self.totext(c2).strip()
|
val = self.totext(c2)
|
||||||
val = val.replace('\u200e', '').replace('\u200f', '')
|
val = val.replace('\u200e', '').replace('\u200f', '')
|
||||||
if not val:
|
if not val:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user