Skip to content
Browse files

Merge branch 'master' of https://github.com/hmason/gitmarks

  • Loading branch information...
2 parents da79f97 + 756fe27 commit 9b3815e5622e2c9e9927aece2614b166384fd4c2 @cwarden committed Dec 20, 2010
Showing with 12 additions and 2 deletions.
  1. +12 −2 gitmark.py
View
14 gitmark.py
@@ -66,13 +66,23 @@ def gitPush(self):
pipe.wait()
def saveContent(self, filename, content):
- f = open('%s%s' % (CONTENT_PATH, filename), 'w')
+ try:
+ f = open('%s%s' % (CONTENT_PATH, filename), 'w')
+ except IOError: #likely the dir doesn't exist
+ os.mkdir(CONTENT_PATH,0755)
+ f = open('%s%s' % (CONTENT_PATH, filename), 'w')
+
f.write(content)
f.close()
return '%s%s' % (CONTENT_PATH, filename)
def saveTagData(self, tag, url, title, content_filename):
- tag_writer = csv.writer(open('%s%s' % (TAG_PATH, tag), 'a'))
+ try:
+ tag_writer = csv.writer(open('%s%s' % (TAG_PATH, tag), 'a'))
+ except IOError:
+ os.mkdir(TAG_PATH,0755)
+ tag_writer = csv.writer(open('%s%s' % (TAG_PATH, tag), 'a'))
+
tag_writer.writerow([url, title, content_filename])
return '%s%s' % (TAG_PATH, tag)

0 comments on commit 9b3815e

Please sign in to comment.
Something went wrong with that request. Please try again.