Commit 778bf0116c8c05e3e00a77a9c421c312092fb06a
1 parent
e6a948d0
added method for extracting file contents
Showing
1 changed file
with
5 additions
and
0 deletions
| @@ -22,6 +22,11 @@ from .initial_data import ( | @@ -22,6 +22,11 @@ from .initial_data import ( | ||
| 22 | 22 | ||
| 23 | TIMEZONE = timezone('Europe/Kiev') | 23 | TIMEZONE = timezone('Europe/Kiev') |
| 24 | 24 | ||
| 25 | + | ||
| 26 | +def get_file_contents(path): | ||
| 27 | + with open(path, 'r') as f: | ||
| 28 | + return unicode(f.read()) or u'' | ||
| 29 | + | ||
| 25 | def get_date(): | 30 | def get_date(): |
| 26 | return datetime.now().isoformat() | 31 | return datetime.now().isoformat() |
| 27 | 32 |
Please
register
or
login
to post a comment