fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactoring: replaced locals() by explicit dicts
[wolnelektury.git]
/
src
/
wolnelektury
/
utils.py
diff --git
a/src/wolnelektury/utils.py
b/src/wolnelektury/utils.py
index
0c256e5
..
e8aa7fb
100644
(file)
--- a/
src/wolnelektury/utils.py
+++ b/
src/wolnelektury/utils.py
@@
-2,16
+2,24
@@
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
+import os
import pytz
from django.utils import timezone
from django.conf import settings
tz = pytz.timezone(settings.TIME_ZONE)
import pytz
from django.utils import timezone
from django.conf import settings
tz = pytz.timezone(settings.TIME_ZONE)
+
def localtime_to_utc(localtime):
return timezone.utc.normalize(
tz.localize(localtime)
)
def localtime_to_utc(localtime):
return timezone.utc.normalize(
tz.localize(localtime)
)
+
def utc_for_js(dt):
return dt.strftime('%Y/%m/%d %H:%M:%S UTC')
def utc_for_js(dt):
return dt.strftime('%Y/%m/%d %H:%M:%S UTC')
+
+
+def makedirs(path):
+ if not os.path.isdir(path):
+ os.makedirs(path)