ox.makedirs

This commit is contained in:
j 2011-04-06 15:24:32 +02:00
parent 515d769f9f
commit 9a05621d69
2 changed files with 9 additions and 2 deletions

View file

@ -11,7 +11,7 @@ import subprocess
from ox.utils import json
__all__ = ['sha1sum', 'oshash', 'avinfo']
__all__ = ['sha1sum', 'oshash', 'avinfo', 'makedirs']
def sha1sum(filename):
sha1 = hashlib.sha1()
@ -80,3 +80,11 @@ def avinfo(filename):
return info
return {'path': filename, 'size': 0}
def makedirs(path):
if not os.path.exists(path):
try:
os.makedirs(path)
except OSError, e:
if e.errno != 17:
raise

View file

@ -13,4 +13,3 @@ except ImportError:
except ImportError:
from django.utils import simplejson as json