mirror of
https://github.com/ivuorinen/aeonview.git
synced 2026-03-01 15:53:35 +00:00
curl creates dirs
This commit is contained in:
18
aeonview.py
18
aeonview.py
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user