summaryrefslogtreecommitdiff
path: root/AllAboutData/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'AllAboutData/utils.py')
-rw-r--r--AllAboutData/utils.py30
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")
+