equal
deleted
inserted
replaced
51 |
51 |
52 encoding is guessed by locale.getpreferredencoding() |
52 encoding is guessed by locale.getpreferredencoding() |
53 """ |
53 """ |
54 # date format may depend on the locale |
54 # date format may depend on the locale |
55 encoding = locale.getpreferredencoding(do_setlocale=False) or 'UTF-8' |
55 encoding = locale.getpreferredencoding(do_setlocale=False) or 'UTF-8' |
56 return unicode(date.strftime(fmt), encoding) |
56 return unicode(date.strftime(str(fmt)), encoding) |
57 |
57 |
58 def make_uid(key): |
58 def make_uid(key): |
59 """forge a unique identifier""" |
59 """forge a unique identifier""" |
60 msg = str(key) + "%.10f"%time() + str(randint(0, 1000000)) |
60 msg = str(key) + "%.10f"%time() + str(randint(0, 1000000)) |
61 return md5(msg).hexdigest() |
61 return md5(msg).hexdigest() |