Commit a9d0d677c11cb434909970a732832263fc5cf26b

Authored by Andrew Yanovych
1 parent 09c7e5ab

added keyword - create file

1 1 # -*- coding: utf-8 -
2 2 import os
  3 +from tempfile import NamedTemporaryFile
3 4 from munch import munchify, Munch, fromYAML
4 5 from json import load
5 6 from iso8601 import parse_date
... ... @@ -21,6 +22,13 @@ from .initial_data import (
21 22 )
22 23
23 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 32 def get_date():
25 33 return datetime.now().isoformat()
26 34
... ...
Please register or login to post a comment