Showing
1 changed file
with
8 additions
and
0 deletions
1 | # -*- coding: utf-8 - | 1 | # -*- coding: utf-8 - |
2 | import os | 2 | import os |
3 | +from tempfile import NamedTemporaryFile | ||
3 | from munch import munchify, Munch, fromYAML | 4 | from munch import munchify, Munch, fromYAML |
4 | from json import load | 5 | from json import load |
5 | from iso8601 import parse_date | 6 | from iso8601 import parse_date |
@@ -21,6 +22,13 @@ from .initial_data import ( | @@ -21,6 +22,13 @@ from .initial_data import ( | ||
21 | ) | 22 | ) |
22 | 23 | ||
23 | TIMEZONE = timezone('Europe/Kiev') | 24 | TIMEZONE = timezone('Europe/Kiev') |
25 | + | ||
26 | +def create_file(content): | ||
27 | + tf = NamedTemporaryFile(delete=False) | ||
28 | + tf.write(content) | ||
29 | + tf.close() | ||
30 | + return tf.name | ||
31 | + | ||
24 | def get_date(): | 32 | def get_date(): |
25 | return datetime.now().isoformat() | 33 | return datetime.now().isoformat() |
26 | 34 |
Please
register
or
login
to post a comment