Fix a few minor nits

- Add missing args in format strings
- Add missing `self` or `cls` param
- Use new style class in one location where it makes sense
This commit is contained in:
Eitan Adler 2017-08-29 00:59:10 -07:00
parent 043c5cbfe5
commit 14c6a84f16
4 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ from calibre.constants import islinux
from calibre.utils.icu import sort_key, strcmp
class Item:
class Item(object):
def __init__(self, name, label, index, icon, exists):
self.name = name
@ -22,7 +22,7 @@ class Item:
self.exists = exists
def __str__(self):
return 'name=%s, label=%s, index=%s, exists='%(self.name, self.label, self.index, self.exists)
return 'name=%s, label=%s, index=%s, exists=%s'%(self.name, self.label, self.index, self.exists)
class TagCategories(QDialog, Ui_TagCategories):

View File

@ -475,7 +475,7 @@ def books_in(ctx, rd, encoded_category, encoded_item, library_id):
try:
dname, ditem = map(decode_name, (encoded_category, encoded_item))
except:
raise HTTPNotFound('Invalid encoded param: %r' % (encoded_category, encoded_item))
raise HTTPNotFound('Invalid encoded param: %r (%r)' % (encoded_category, encoded_item))
num, offset = get_pagination(rd.query)
sort, sort_order = rd.query.get('sort', 'title'), rd.query.get('sort_order')
sort_order = ensure_val(sort_order, 'asc', 'desc')

View File

@ -71,7 +71,7 @@ def digest(un, pw, nonce=None, uri=None, method='GET', nc=1, qop='auth', realm=R
def __init__(self):
self.method = method
def peek():
def peek(self):
return body
response = da.request_digest(pw, Data())
return ('Digest ' + templ.format(

View File

@ -452,7 +452,7 @@ class BasicNewsRecipe(Recipe):
return self.feeds
@classmethod
def print_version(self, url):
def print_version(cls, url):
'''
Take a `url` pointing to the webpage with article content and return the
:term:`URL` pointing to the print version of the article. By default does