diff options
author | Lionel <lionel.miquel46@gmail.com> | 2018-10-21 14:53:51 +0200 |
---|---|---|
committer | Lionel <lionel.miquel46@gmail.com> | 2018-10-21 14:53:51 +0200 |
commit | b3ee49d174a35bbf4da6b1c60059795fdb88f710 (patch) | |
tree | 8b6c371d02eb30cd0ec874004dbabb0d8e93d33f /foldercreating.py | |
parent | 7fbd76c1e51bf1cc3094b7d2286668cd839675fe (diff) | |
download | randopitons-b3ee49d174a35bbf4da6b1c60059795fdb88f710.tar.gz randopitons-b3ee49d174a35bbf4da6b1c60059795fdb88f710.zip |
Finally I'll rewrite it in bash i find it more readable than my python scripts. Will plan on a powershell version too
Diffstat (limited to 'foldercreating.py')
-rw-r--r-- | foldercreating.py | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/foldercreating.py b/foldercreating.py deleted file mode 100644 index 489d588..0000000 --- a/foldercreating.py +++ /dev/null @@ -1,82 +0,0 @@ -import subprocess -import os -import time -import colorcode as clc -import errmsg as e -import randoweb as rdo -#global foldernames - -thehome=os.path.expanduser("~") -defoldername="/Randopitons" -def_folder=thehome+defoldername -a_folder=0 - - - - -def defolder(): - try: - print "\nCreating default folder "+def_folder+" ..." - os.mkdir(def_folder) - except OSError,er: - print e.os - print format(er) - -def mainfolder(): - try: - a_folder=input("\n\nWhich folder would you want to download the files to [Default to home directory "+def_folder+"]") - os.mkdir(a_folder) - print "Folder "+a_folder+" was created successfully" - except OSError, er: - #errors out if folder exists else print the error (can be permissions or anything else) - if e.errno != os.errno.EEXIST: - raise - else: - print e.os - print format(er) - pass - - except SyntaxError: - os.mkdir(def_folder) - except KeyboardInterrupt: - print e.sigkill - except: - raise - -def mkfolder(MAIL,PSW,regionnames,foldernames,maptype,ptr,bfn): - - try: - if a_folder==0: - os.mkdir(os.path.join(def_folder,foldernames[ptr])) - else: - os.mkdir(os.path.join(a_folder,foldernames[ptr])) - #rdo.testalakon() - rdo.randoweb(MAIL,PSW,regionnames[ptr],maptype,bfn,def_folder+a_str) - except OSError, er: - print e.os - print format(er) - - -def mkallfolder(MAIL,PSW,regionnames,foldernames,maptype,bfn): - iii=0 - a_str="str" - try: - for a_str in foldernames: - if a_folder==0: - os.mkdir(os.path.join(def_folder,a_str)) - else: - os.mkdir(os.path.join(a_folder,a_str)) - - - try: - print "on attaque par le "+regionnames[iii] - rdo.randoweb(MAIL,PSW,regionnames[iii],maptype,bfn,def_folder+a_str) - except: - raise - iii=iii+1 - #subprocess.call("rm -d "+fullpath) - print "All folders were created successfully" - except OSError, er: - print e.os - print format(er) - |