mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: make sure division is really floored
This commit is contained in:
parent
c9f8ffedb1
commit
dde0e3cd9d
@ -73,7 +73,7 @@ class ConfigWidget(QWidget, Ui_ConfigWidget):
|
|||||||
if isinstance(extra_customization_message, list):
|
if isinstance(extra_customization_message, list):
|
||||||
self.opt_extra_customization = []
|
self.opt_extra_customization = []
|
||||||
if len(extra_customization_message) > 6:
|
if len(extra_customization_message) > 6:
|
||||||
row_func = lambda x, y: ((x/2) * 2) + y
|
row_func = lambda x, y: ((x//2) * 2) + y
|
||||||
col_func = lambda x: x%2
|
col_func = lambda x: x%2
|
||||||
else:
|
else:
|
||||||
row_func = lambda x, y: x*2 + y
|
row_func = lambda x, y: x*2 + y
|
||||||
|
@ -255,7 +255,7 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
|
|||||||
|
|
||||||
for i in range(0, self.table.rowCount()*2):
|
for i in range(0, self.table.rowCount()*2):
|
||||||
self.start_find_pos = (self.start_find_pos + 1) % (self.table.rowCount()*2)
|
self.start_find_pos = (self.start_find_pos + 1) % (self.table.rowCount()*2)
|
||||||
r = (self.start_find_pos/2)%self.table.rowCount()
|
r = (self.start_find_pos//2)%self.table.rowCount()
|
||||||
c = self.start_find_pos % 2
|
c = self.start_find_pos % 2
|
||||||
item = self.table.item(r, c)
|
item = self.table.item(r, c)
|
||||||
text = icu_lower(unicode_type(item.text()))
|
text = icu_lower(unicode_type(item.text()))
|
||||||
|
@ -458,7 +458,7 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
if self.fm[key]['display'].get('allow_half_stars', False):
|
if self.fm[key]['display'].get('allow_half_stars', False):
|
||||||
vals = unicode_type(vals/2.0)
|
vals = unicode_type(vals/2.0)
|
||||||
else:
|
else:
|
||||||
vals = unicode_type(vals/2)
|
vals = unicode_type(vals//2)
|
||||||
if not isinstance(vals, list):
|
if not isinstance(vals, list):
|
||||||
vals = [vals]
|
vals = [vals]
|
||||||
vals.sort(key=sort_key)
|
vals.sort(key=sort_key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user