IGN:Fix localization of timestamp for device files

This commit is contained in:
Kovid Goyal 2008-07-16 13:10:03 -07:00
parent c4eb7fea8b
commit 28a93ca9c7
4 changed files with 13 additions and 8 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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]