summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2021-02-16 18:19:42 +0100
committerAndré Glüpker <git@wgmd.de>2021-02-16 18:19:42 +0100
commitc91e9cb8d8e6f0bf5edc0f5768f8dfd50a23d44f (patch)
treeffeb133b45336bd8a342797614169e6c2ffe0ad6 /main.py
parentc4db6130dcf2c78b3b0e05bc98d9a830a51dbfe3 (diff)
downloadsteam-c91e9cb8d8e6f0bf5edc0f5768f8dfd50a23d44f.tar.gz
steam-c91e9cb8d8e6f0bf5edc0f5768f8dfd50a23d44f.tar.bz2
steam-c91e9cb8d8e6f0bf5edc0f5768f8dfd50a23d44f.zip
Show some stats and have links on premade finder
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.py b/main.py
index f5def41..e39eb5f 100755
--- a/main.py
+++ b/main.py
@@ -42,7 +42,10 @@ intervals = (
('s', 1),
)
-def display_time(seconds, granularity=2):
+def display_time(timestamp, format="%d.%m.%Y"):
+ return datetime.datetime.fromtimestamp(timestamp).strftime(format)
+
+def display_age(seconds, granularity=2):
result = []
for name, count in intervals:
value = seconds // count
@@ -54,6 +57,7 @@ def display_time(seconds, granularity=2):
return ' '.join(result[:granularity])
app.jinja_env.filters['display_time'] = display_time
+app.jinja_env.filters['display_age'] = display_age
def grepSteamids(text):
steamids = []