commit 8f75040ead8204ba95a23292290fa55dde1a4b7a
parent ba1f9b78521993fb2318e88bb2a73a4b5fff9d2f
Author: gearsix <gearsix@tuta.io>
Date: Sun, 6 Jun 2021 13:43:39 +0100
changed some mkdir calls to os.makedirs
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/dotfm.py b/src/dotfm.py
@@ -147,7 +147,7 @@ def init_createcsv(default_location):
if len(on) > 0:
if on[0] == 'o': # create file at location & write KNOWN[0] to it
warn('overwriting {}, all existing data in this file will be lost'.format(location))
- os.system('mkdir -p', os.path.dirname(location))
+ os.makedirs(os.path.dirname(location))
dotfm_csv = open(location, "w")
for i, dfl in enumerate(KNOWN[0]):
dotfm_csv.write(dfl if i == 0 else ',{}'.format(dfl))
@@ -156,15 +156,15 @@ def init_createcsv(default_location):
elif on[0] == 'u':
debug('using pre-existing csv {}'.format(location))
sys.exit()
+ os.makedirs(default_location)
+ os.makedirs(os.path.dirname(location))
# create default_location symlink
if os.path.abspath(location) != os.path.abspath(default_location):
debug('creating dotfm csv file symlink')
- os.system('mkdir -p', os.path.dirname(default_location))
os.system('ln -isv', os.path.abspath(location), default_location)
else:
f = open(location, "w")
f.close()
-
def init_loadcsv(location):
dotfm_csv = open(location, "r")