Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
except(Exception) as error:
debugLog(style.YELLOW, "/!\ This script will computeAll plantability in all territory")
# Launch function
computeAll(int(secArgv), thirdArgv)
else:
debugLog(style.RED, "The grid size value is not a number. Please correct your input")
elif firstArgv == 'test':
secArgv = sys.argv[1:][1]
test(secArgv)
elif firstArgv == 'help':
showDoc()
else:
showDoc()
debugLog(style.RED, "Unrecognized arguments for this script", logging.ERROR)
else:
showDoc()
if __name__ == "__main__":
# Enable windows native color
os.system("")
# Init logs directory
logsPath = './logs/'
checkAndCreateDirectory(logsPath)
# Init logging
initLogging(logsPath)
# Load .env values
load_dotenv()
# Check .env file initialization
checkEnvFile()
# Init env variable
initEnv()
# Only print in console
print(style.YELLOW + "Current database settings : {} - {} \n".format(DB_params['host'], DB_params['database']), style.RESET)
# Check if ./tmp/ folder exist then create if not
tmpPath = './tmp/'
checkAndCreateDirectory(tmpPath)
# Launch main function
main()