Mercurial > libervia-backend
comparison sat_frontends/jp/common.py @ 3715:b9718216a1c0 0.9
merge bookmark 0.9
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 01 Dec 2021 16:13:31 +0100 |
parents | 742e466fa000 |
children | 524856bd7b19 |
comparison
equal
deleted
inserted
replaced
3714:af09b5aaa5d7 | 3715:b9718216a1c0 |
---|---|
49 } | 49 } |
50 | 50 |
51 SECURE_UNLINK_MAX = 10 | 51 SECURE_UNLINK_MAX = 10 |
52 SECURE_UNLINK_DIR = ".backup" | 52 SECURE_UNLINK_DIR = ".backup" |
53 METADATA_SUFF = "_metadata.json" | 53 METADATA_SUFF = "_metadata.json" |
54 | |
55 | |
56 def format_time(timestamp): | |
57 """Return formatted date for timestamp | |
58 | |
59 @param timestamp(str,int,float): unix timestamp | |
60 @return (unicode): formatted date | |
61 """ | |
62 fmt = "%d/%m/%Y %H:%M:%S %Z" | |
63 return time.strftime(fmt, time.localtime(float(timestamp))) | |
54 | 64 |
55 | 65 |
56 def ansi_ljust(s, width): | 66 def ansi_ljust(s, width): |
57 """ljust method handling ANSI escape codes""" | 67 """ljust method handling ANSI escape codes""" |
58 cleaned = regex.ansiRemove(s) | 68 cleaned = regex.ansiRemove(s) |