From 6531e1ea67e1a921cd037f44979f47b332804b41 Mon Sep 17 00:00:00 2001 From: Ioannis Spingos Date: Fri, 31 Jul 2020 13:44:52 +0300 Subject: [PATCH] [Version 0.2.1] Critical Fix - Fixed an issue that would prevent the program from launching in a fresh environment. - Mandatory directories will now be created on startup, if they do not exist. --- pytheas/pytheas.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pytheas/pytheas.py b/pytheas/pytheas.py index 79e58f0..065f8be 100644 --- a/pytheas/pytheas.py +++ b/pytheas/pytheas.py @@ -49,8 +49,8 @@ global VERSION global VERDATE -VERSION="0.2.0" -VERDATE="07/05/2020" +VERSION="0.2.1" +VERDATE="31/07/2020" ## first get script's path import os @@ -126,11 +126,24 @@ from lib import db_handler as DB from lib import tools from lib import parsers -# make 'logs' directory + +#-- make required directories try: os.makedirs(os.path.join(WORKDIR, 'logs')) except: # if folder already exists pass +try: + os.makedirs(os.path.join(WORKDIR, 'etc', 'options')) +except: # if folder already exists + pass +try: + os.makedirs(os.path.join(WORKDIR, 'etc', 'evcor')) +except: # if folder already exists + pass +try: + os.makedirs(os.path.join(WORKDIR, 'etc', 'index')) +except: # if folder already exists + pass # init the log file logfile=WORKDIR+os.sep+"logs%s%s_Pytheas.log" % (os.sep,UTCDateTime().strftime("%Y%m%d%H%M%S"))