mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1906198 [<0.0 kb file size in Device View](https://bugs.launchpad.net/calibre/+bug/1906198)
This commit is contained in:
parent
3dc4a91572
commit
46aa4f2b2e
@ -13,7 +13,7 @@ from itertools import groupby
|
||||
from PyQt5.Qt import (QAbstractTableModel, Qt, pyqtSignal, QIcon, QImage, QFont,
|
||||
QModelIndex, QDateTime, QColor, QPixmap, QPainter, QApplication)
|
||||
|
||||
from calibre import fit_image, force_unicode, prepare_string_for_xml
|
||||
from calibre import fit_image, force_unicode, prepare_string_for_xml, human_readable
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre.utils.search_query_parser import ParseException
|
||||
from calibre.ebooks.metadata import fmt_sidx, authors_to_string, string_to_authors
|
||||
@ -35,12 +35,6 @@ from polyglot.builtins import iteritems, itervalues, unicode_type, string_or_byt
|
||||
|
||||
Counts = namedtuple('Counts', 'library_total total current')
|
||||
|
||||
|
||||
def human_readable(size, precision=1):
|
||||
""" Convert a size in bytes into megabytes """
|
||||
return ('%.'+unicode_type(precision)+'f') % (size/(1024*1024))
|
||||
|
||||
|
||||
TIME_FMT = '%d %b %Y'
|
||||
|
||||
ALIGNMENT_MAP = {'left': Qt.AlignmentFlag.AlignLeft, 'right': Qt.AlignmentFlag.AlignRight, 'center':
|
||||
|
Loading…
x
Reference in New Issue
Block a user