create ~/.config and ~/.cache folder if they don't exist

This commit is contained in:
Yann Leboulanger 2010-07-10 11:03:46 +02:00
parent 5e012ff428
commit 337b09d389
1 changed files with 5 additions and 0 deletions

View File

@ -334,5 +334,10 @@ def check_and_possibly_create_paths():
sys.exit()
def create_path(directory):
head, tail = os.path.split(directory)
if not os.path.exists(head):
create_path(head)
if os.path.exists(directory):
return
print _('creating %s directory') % directory
os.mkdir(directory, 0700)