diff options
author | Rasmus Luha <rasmus.luha@gmail.com> | 2022-03-17 00:47:22 +0200 |
---|---|---|
committer | Rasmus Luha <rasmus.luha@gmail.com> | 2022-03-17 00:47:22 +0200 |
commit | ab2efcde6a5fac062ace86aa1705dc47ce69f438 (patch) | |
tree | e91491dfb56459866001ff4a6cd4cee547eec1f1 /AllAboutData/utils.py | |
parent | ecb4b4c8c56d9f720ba004fcfefd40acb996cc7e (diff) |
Little Restructuring
Diffstat (limited to 'AllAboutData/utils.py')
-rw-r--r-- | AllAboutData/utils.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/AllAboutData/utils.py b/AllAboutData/utils.py new file mode 100644 index 0000000..d5f36cf --- /dev/null +++ b/AllAboutData/utils.py @@ -0,0 +1,30 @@ +import os +import sys + +# terminal commands, which are unfortunately os-specific +def whichOs(): + ''' Returns "windows" if used os is windows. If not, returns "good" ''' + + if sys.platform == "win32": + return "windows" + else: + return "good" + +def deleteDataDir(): + ''' Removes Data directory from working directroy ''' + + if whichOs() == "windows": + os.system("rmdir \s Data") + else: + os.system("rm -r Data") + + +def addDataDir(): + ''' Adds data directory from working directroy ''' + + if whichOs() == "windows": + os.system("mkdir Data\Players") + else: + os.system("mkdir -p Data/Players") + print("Created new empty Data directory") + |