Skip to content

Commit

Permalink
Use floor division
Browse files Browse the repository at this point in the history
  • Loading branch information
troxor authored and louipc committed Nov 3, 2016
1 parent 23dfa42 commit e41fe46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tremc
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ class Interface(object):
self.lines_per_entry = 3 if self.blank_lines else 2
self.tlist_item_height = self.lines_per_entry if not self.compact_list else 1
self.mainview_height = self.height - 2
self.torrents_per_page = self.mainview_height / self.tlist_item_height
self.torrents_per_page = self.mainview_height // self.tlist_item_height

def run(self):
self.draw_title_bar()
Expand Down Expand Up @@ -1565,7 +1565,7 @@ class Interface(object):
piece_count = self.torrent_details['pieceCount']
margin = len(str(piece_count)) + 2
map_width = int(str(self.width-margin-1)[0:-1] + '0')
list_len = int(piece_count / map_width) + 1
list_len = (piece_count // map_width) + 1

if list_len:
if c == curses.KEY_UP or c == ord('k') or c == curses.ascii.ctrl(ord('p')):
Expand Down

0 comments on commit e41fe46

Please sign in to comment.