If config does not exist we exit and tell user to follow readme

This commit is contained in:
2019-04-29 21:33:20 +02:00
parent dce5a070ca
commit 80013af814

View File

@@ -2,13 +2,17 @@
import os, sys
from subprocess import check_output, Popen, PIPE
from configparser import ConfigParser
print('test')
def getConfig():
print('Reading config')
config = ConfigParser()
pwd = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(pwd, 'config.ini')
if not os.path.isfile(path):
print('Please fill out and rename config file. Check README for more info.')
exit(0)
config = ConfigParser()
config.read(path)
print('Sections parsed: {}'.format(config.sections()))