curl creates dirs

This commit is contained in:
Ismo Vuorinen
2010-08-04 06:14:35 +00:00
parent 18363b4650
commit d8480aa4d6

View File

@@ -124,8 +124,8 @@ def aeonview(argv):
# Crude, but works. # Crude, but works.
if options.simulate == False: if options.simulate == False:
mkdir_p( options.destdir ) #mkdir_p( options.destdir )
os.system('curl --silent %s' % getit) os.system('curl --create-dirs --silent %s' % getit)
else: else:
print "(!) Simulation: Making path:", options.destdir print "(!) Simulation: Making path:", options.destdir
print "(!) Simulation: curl", getit print "(!) Simulation: curl", getit
@@ -185,13 +185,13 @@ def aeonview(argv):
# http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 # http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612
def mkdir_p(path): #def mkdir_p(path):
try: # try:
os.makedirs(path) # os.makedirs(path)
except OSError as exc: # Python >2.5 # except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST: # if exc.errno == errno.EEXIST:
pass # pass
else: raise # else: raise
# Modified http://markmail.org/message/k2pxsle2lslrmnut # Modified http://markmail.org/message/k2pxsle2lslrmnut