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
@ -30,6 +30,11 @@ islinux = not(iswindows or isosx)
|
|||||||
try:
|
try:
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
except:
|
except:
|
||||||
|
dl = locale.getdefaultlocale()
|
||||||
|
try:
|
||||||
|
if dl:
|
||||||
|
locale.setlocale(dl[0])
|
||||||
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -691,7 +691,7 @@ class DeviceBooksModel(BooksModel):
|
|||||||
dt = item.datetime
|
dt = item.datetime
|
||||||
dt = datetime(*dt[0:6])
|
dt = datetime(*dt[0:6])
|
||||||
dt = dt - timedelta(seconds=time.timezone) + timedelta(hours=time.daylight)
|
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)
|
data[_('Tags')] = ', '.join(item.tags)
|
||||||
self.emit(SIGNAL('new_bookdisplay_data(PyQt_PyObject)'), data)
|
self.emit(SIGNAL('new_bookdisplay_data(PyQt_PyObject)'), data)
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ def download_tarball():
|
|||||||
if pb is not None:
|
if pb is not None:
|
||||||
pb.update(percent)
|
pb.update(percent)
|
||||||
else:
|
else:
|
||||||
print '%d%%, '%int(percent*100)
|
print '%d%%, '%int(percent*100),
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
return f
|
return f
|
||||||
|
|
||||||
|
@ -145,12 +145,12 @@ if hasattr(sys, 'frameworks_dir'):
|
|||||||
elif not lib.FcInit():
|
elif not lib.FcInit():
|
||||||
raise RuntimeError(_('Could not initialize the fontconfig library'))
|
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.
|
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
|
`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]
|
allowed_extensions = [i.lower() for i in allowed_extensions]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user