aboutsummaryrefslogtreecommitdiff
path: root/foldercreating.py
diff options
context:
space:
mode:
Diffstat (limited to 'foldercreating.py')
-rw-r--r--foldercreating.py56
1 files changed, 28 insertions, 28 deletions
diff --git a/foldercreating.py b/foldercreating.py
index a6fa34f..c1f4b23 100644
--- a/foldercreating.py
+++ b/foldercreating.py
@@ -7,35 +7,14 @@ import errmsg as e
#(foldernames[0].split(' ')[0]+"-"+foldernames[0].split(' ')[2]).lower() => cirque-cilaos . ce formating sera pratique lors de la récupération sur site web
thehome=os.path.expanduser("~")
-thefolder="/Randopitons"
-default_folder=thehome+thefolder
-
-
-def mkfolder(maptype,choice):
- folderptr=choice-1
- fullpath=thehome+"/"+foldernames[folderptr]
- try:
- if foldernames[folderptr] == "All":
- for foldernames in totalfolders:
- os.mkdir(os.path.join(thehome,str(foldernames)))
- #subprocess.call("rm -d "+fullpath)
- print "All folders were created successfully"
- else:
- os.mkdir(fullpath)
- print "Folder "+fullpath+"was created successfully"
-
-
- for foldernames in tolimit:
- os.mkdir(os.path.join(thehome,str(foldernames)))
-
- except OSError, e:
- print e.os
- print format(e)
+defoldername="/Randopitons"
+def_folder=thehome+defoldername
+fullpath=thehome+"/"+foldernames[regionptr]
def mainfolder():
try:
- chosing_folder=input("\n\nWhich folder would you want to download the files to [Default to home directory "+default_folder+"]")
- print "Folder "+chosing_folder+" was created successfully"
+ a_folder=input("\n\nWhich folder would you want to download the files to [Default to home directory "+def_folder+"]")
+ print "Folder "+a_folder+" was created successfully"
except OSError, e:
#errors out if folder exists else print the error (can be permissions or anything else)
if e.errno == os.errno.EEXIST:
@@ -45,7 +24,28 @@ def mainfolder():
print format(e)
pass
except SyntaxError:
- print "\nCreating default folder "+default_folder+" ..."
- os.mkdir(default_folder)
+ print "\nCreating default folder "+def_folder+" ..."
+ os.mkdir(def_folder)
+
+def mkfolder(choice):
+ regionptr=choice-1
+ try:
+ os.mkdir(os.path.join(thehome,foldernames[regionptr]))
+ except OSError, e:
+ print e.os
+ print format(e)
+
+
+def mkallfolder(choice):
+ try:
+ if choice == 10:
+ for foldernames in range(9):
+ os.mkdir(os.path.join(thehome,str(foldernames)))
+ #subprocess.call("rm -d "+fullpath)
+ print "All folders were created successfully"
+ except OSError, e:
+ print e.os
+ print format(e)
+
#print "Program ended."