aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/tools/__init__.py')
-rw-r--r--src/ee/tools/__init__.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ee/tools/__init__.py b/src/ee/tools/__init__.py
index e69de29..893ee31 100644
--- a/src/ee/tools/__init__.py
+++ b/src/ee/tools/__init__.py
@@ -0,0 +1,21 @@
+import os.path
+
+
+def _mkdir_and_open(path):
+ dirname = os.path.dirname(path)
+
+ if len(dirname) > 0:
+ if not os.path.isdir(dirname):
+ os.mkdir(dirname)
+
+ return open(path, "w")
+
+
+def mk_parents(path: str):
+ dirname = os.path.dirname(path)
+
+ if len(dirname) == 0:
+ return
+
+ if not os.path.isdir(dirname):
+ os.mkdir(dirname)