ctrochalakis /
tx-submissions
(http://transifex.org/)
fork of transifex
GSoC '08: Introducing a new transifex submission system, an api and a command line client
Clone URL : http://bitbucket.org/ctrochalakis/tx-submissions/ (size: 1.4 MB)
| commit 457: | d617dcad170f |
| parent 456: | 8df42ff447b9 |
| branch: | default |
Teach save_file_contents() to recursively create directories. Thanks Toshio!
Changed (Δ122 bytes):
raw changeset »
transifex/submissions/methods/__init__.py (4 lines added, 0 lines removed)
Up to file-list transifex/submissions/methods/__init__.py:
| … | … | @@ -54,6 +54,10 @@ class BrowserMixin: |
54 |
54 |
first encoded with the <encode> encoding. |
55 |
55 |
""" |
56 |
56 |
fullpath = os.path.join(self.path, filename) |
57 |
dirpath = os.path.dirname(fullpath) |
|
58 |
if not os.access(dirpath, os.F_OK): |
|
59 |
os.makedirs(dirpath) |
|
60 |
||
57 |
61 |
if encode: |
58 |
62 |
contents = contents.encode(encode) |
59 |
63 |
fp = open(fullpath, 'w') |
