mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
43e6b36e15
commit
e6d838ad45
@ -2,7 +2,6 @@ from calibre.web.feeds.news import BasicNewsRecipe, classes
|
|||||||
from calibre import browser
|
from calibre import browser
|
||||||
from html5_parser import parse
|
from html5_parser import parse
|
||||||
import json
|
import json
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
class Bloomberg(BasicNewsRecipe):
|
class Bloomberg(BasicNewsRecipe):
|
||||||
@ -133,7 +132,7 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
body += '<span id="cap">' + objects['data']['photo']['caption'] + '</span></p>'
|
body += '<span id="cap">' + objects['data']['photo']['caption'] + '</span></p>'
|
||||||
if objects['type'] == 'paragraph' or 'heading':
|
if objects['type'] == 'paragraph' or 'heading':
|
||||||
body += '<p>'
|
body += '<p>'
|
||||||
if not 'content' in objects:
|
if 'content' not in objects:
|
||||||
continue
|
continue
|
||||||
for content in objects['content']:
|
for content in objects['content']:
|
||||||
if 'value' in content:
|
if 'value' in content:
|
||||||
|
@ -3,7 +3,6 @@ from calibre import browser
|
|||||||
from html5_parser import parse
|
from html5_parser import parse
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
import json
|
import json
|
||||||
import re
|
|
||||||
|
|
||||||
class Bloomberg(BasicNewsRecipe):
|
class Bloomberg(BasicNewsRecipe):
|
||||||
title = u'Bloomberg'
|
title = u'Bloomberg'
|
||||||
@ -128,7 +127,7 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
body += '<span id="cap">' + objects['data']['photo']['caption'] + '</span></p>'
|
body += '<span id="cap">' + objects['data']['photo']['caption'] + '</span></p>'
|
||||||
if objects['type'] == 'paragraph' or 'heading': # lists are missed :(
|
if objects['type'] == 'paragraph' or 'heading': # lists are missed :(
|
||||||
body += '<p>'
|
body += '<p>'
|
||||||
if not 'content' in objects:
|
if 'content' not in objects:
|
||||||
continue
|
continue
|
||||||
for content in objects['content']:
|
for content in objects['content']:
|
||||||
if 'value' in content:
|
if 'value' in content:
|
||||||
|
@ -1251,11 +1251,15 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
filter_by = self.filter_categories_by
|
filter_by = self.filter_categories_by
|
||||||
|
|
||||||
if prefs['use_primary_find_in_search']:
|
if prefs['use_primary_find_in_search']:
|
||||||
final_equals = lambda x, y: primary_strcmp(x, y) == 0
|
def final_equals(x, y):
|
||||||
final_contains = primary_contains
|
return primary_strcmp(x, y) == 0
|
||||||
|
def final_contains(x, y):
|
||||||
|
return primary_contains(x, y)
|
||||||
else:
|
else:
|
||||||
final_equals = lambda x, y: strcmp(x, y) == 0
|
def final_equals(x, y):
|
||||||
final_contains = lambda filt, txt: contains(filt, icu_lower(txt))
|
return strcmp(x, y) == 0
|
||||||
|
def final_contains(filt, txt):
|
||||||
|
return contains(filt, icu_lower(txt))
|
||||||
|
|
||||||
for category in data.keys():
|
for category in data.keys():
|
||||||
if use_exact_match:
|
if use_exact_match:
|
||||||
@ -1853,11 +1857,15 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
start_path = []
|
start_path = []
|
||||||
|
|
||||||
if prefs['use_primary_find_in_search']:
|
if prefs['use_primary_find_in_search']:
|
||||||
final_equals = lambda x, y: primary_strcmp(x, y) == 0
|
def final_equals(x, y):
|
||||||
final_contains = primary_contains
|
return primary_strcmp(x, y) == 0
|
||||||
|
def final_contains(x, y):
|
||||||
|
return primary_contains(x, y)
|
||||||
else:
|
else:
|
||||||
final_equals = lambda x, y: strcmp(x, y) == 0
|
def final_equals(x, y):
|
||||||
final_contains = lambda filt, txt: contains(filt, icu_lower(txt))
|
return strcmp(x, y) == 0
|
||||||
|
def final_contains(filt, txt):
|
||||||
|
return contains(filt, icu_lower(txt))
|
||||||
|
|
||||||
def process_tag(depth, tag_index, tag_item, start_path):
|
def process_tag(depth, tag_index, tag_item, start_path):
|
||||||
path = self.path_for_index(tag_index)
|
path = self.path_for_index(tag_index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user