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 html5_parser import parse
|
||||
import json
|
||||
import re
|
||||
|
||||
|
||||
class Bloomberg(BasicNewsRecipe):
|
||||
@ -133,7 +132,7 @@ class Bloomberg(BasicNewsRecipe):
|
||||
body += '<span id="cap">' + objects['data']['photo']['caption'] + '</span></p>'
|
||||
if objects['type'] == 'paragraph' or 'heading':
|
||||
body += '<p>'
|
||||
if not 'content' in objects:
|
||||
if 'content' not in objects:
|
||||
continue
|
||||
for content in objects['content']:
|
||||
if 'value' in content:
|
||||
|
@ -3,7 +3,6 @@ from calibre import browser
|
||||
from html5_parser import parse
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
import json
|
||||
import re
|
||||
|
||||
class Bloomberg(BasicNewsRecipe):
|
||||
title = u'Bloomberg'
|
||||
@ -128,7 +127,7 @@ class Bloomberg(BasicNewsRecipe):
|
||||
body += '<span id="cap">' + objects['data']['photo']['caption'] + '</span></p>'
|
||||
if objects['type'] == 'paragraph' or 'heading': # lists are missed :(
|
||||
body += '<p>'
|
||||
if not 'content' in objects:
|
||||
if 'content' not in objects:
|
||||
continue
|
||||
for content in objects['content']:
|
||||
if 'value' in content:
|
||||
|
@ -1251,11 +1251,15 @@ class TagsModel(QAbstractItemModel): # {{{
|
||||
filter_by = self.filter_categories_by
|
||||
|
||||
if prefs['use_primary_find_in_search']:
|
||||
final_equals = lambda x, y: primary_strcmp(x, y) == 0
|
||||
final_contains = primary_contains
|
||||
def final_equals(x, y):
|
||||
return primary_strcmp(x, y) == 0
|
||||
def final_contains(x, y):
|
||||
return primary_contains(x, y)
|
||||
else:
|
||||
final_equals = lambda x, y: strcmp(x, y) == 0
|
||||
final_contains = lambda filt, txt: contains(filt, icu_lower(txt))
|
||||
def final_equals(x, y):
|
||||
return strcmp(x, y) == 0
|
||||
def final_contains(filt, txt):
|
||||
return contains(filt, icu_lower(txt))
|
||||
|
||||
for category in data.keys():
|
||||
if use_exact_match:
|
||||
@ -1853,11 +1857,15 @@ class TagsModel(QAbstractItemModel): # {{{
|
||||
start_path = []
|
||||
|
||||
if prefs['use_primary_find_in_search']:
|
||||
final_equals = lambda x, y: primary_strcmp(x, y) == 0
|
||||
final_contains = primary_contains
|
||||
def final_equals(x, y):
|
||||
return primary_strcmp(x, y) == 0
|
||||
def final_contains(x, y):
|
||||
return primary_contains(x, y)
|
||||
else:
|
||||
final_equals = lambda x, y: strcmp(x, y) == 0
|
||||
final_contains = lambda filt, txt: contains(filt, icu_lower(txt))
|
||||
def final_equals(x, y):
|
||||
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):
|
||||
path = self.path_for_index(tag_index)
|
||||
|
Loading…
x
Reference in New Issue
Block a user