mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Fix localization of timestamp for device files
This commit is contained in:
parent
c4eb7fea8b
commit
28a93ca9c7
@ -29,6 +29,11 @@ islinux = not(iswindows or isosx)
|
||||
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
except:
|
||||
dl = locale.getdefaultlocale()
|
||||
try:
|
||||
if dl:
|
||||
locale.setlocale(dl[0])
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -691,7 +691,7 @@ class DeviceBooksModel(BooksModel):
|
||||
dt = item.datetime
|
||||
dt = datetime(*dt[0:6])
|
||||
dt = dt - timedelta(seconds=time.timezone) + timedelta(hours=time.daylight)
|
||||
data[_('Timestamp')] = dt.ctime()
|
||||
data[_('Timestamp')] = dt.strftime('%a %b %d %H:%M:%S %Y')
|
||||
data[_('Tags')] = ', '.join(item.tags)
|
||||
self.emit(SIGNAL('new_bookdisplay_data(PyQt_PyObject)'), data)
|
||||
|
||||
|
@ -254,7 +254,7 @@ def download_tarball():
|
||||
if pb is not None:
|
||||
pb.update(percent)
|
||||
else:
|
||||
print '%d%%, '%int(percent*100)
|
||||
print '%d%%, '%int(percent*100),
|
||||
f.seek(0)
|
||||
return f
|
||||
|
||||
|
@ -145,12 +145,12 @@ if hasattr(sys, 'frameworks_dir'):
|
||||
elif not lib.FcInit():
|
||||
raise RuntimeError(_('Could not initialize the fontconfig library'))
|
||||
|
||||
def find_font_families(allowed_extensions=['ttf']):
|
||||
def find_font_families(allowed_extensions=['ttf', 'otf']):
|
||||
'''
|
||||
Return an alphabetically sorted list of font families available on the system.
|
||||
|
||||
`allowed_extensions`: A list of allowed extensions for font file types. Defaults to
|
||||
`['ttf']`. If it is empty, it is ignored.
|
||||
`['ttf', 'otf']`. If it is empty, it is ignored.
|
||||
'''
|
||||
allowed_extensions = [i.lower() for i in allowed_extensions]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user