Made config path correct; Deleted unnecessary stuff; Beautified outpout; Plugin version now correct;

Changes:
- config path will always be correct
- deleted unnexessary stuff
- plugin version will display now correct
- changed some formating
- created SFTP check before launching
This commit is contained in:
Neocky
2021-03-13 22:09:32 +01:00
parent 3fed1580f8
commit ddb5f1172e
9 changed files with 45 additions and 69 deletions

View File

@@ -1,4 +1,4 @@
import os.path
import os
import sys
import configparser
@@ -6,7 +6,10 @@ from utils.consoleoutput import oColors
def checkConfig():
configAvailable = os.path.isfile("./config.ini")
currentFolder = os.getcwd()
os.chdir('..')
configAvailable = os.path.isfile("config.ini")
if not configAvailable:
createConfig()
print(oColors.brightRed + "Config created. Edit config before executing again!" + oColors.standardWhite)
@@ -32,19 +35,20 @@ def checkConfig():
else:
localPluginFolder = False
os.chdir(currentFolder)
return configValues
def createConfig():
config = configparser.ConfigParser(allow_no_value=True)
config['General'] = {}
config['General'][';'] = 'If a local plugin folder exists (True/False): (If False use SFTP)'
config['General'][';'] = 'If a local plugin folder exists (True/False): (If False SFTP will be used)'
config['General']['LocalPluginFolder'] = 'True'
config['General']['PathToPluginFolder'] = 'C:\\Users\\USER\\Desktop\\plugins'
config['SFTP - Remote Server'] = {}
config['SFTP - Remote Server']['Server'] = '0.0.0.0'
config['SFTP - Remote Server']['Username'] = 'user'
config['SFTP - Remote Server']['Password'] = 'longpassword'
config['SFTP - Remote Server']['Password'] = 'password'
config['SFTP - Remote Server'][';'] = 'Normally you won*t need to change anything below this line'
config['SFTP - Remote Server']['Port'] = '22'
config['SFTP - Remote Server']['PluginFolderForUpload'] = '.\\plugins'