Config now expected next to geoffrey.py and console logging fixed.
parent
330fa16970
commit
0e8101d64c
|
@ -1,5 +1,6 @@
|
||||||
import codecs
|
import codecs
|
||||||
import configparser
|
import configparser
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
def create_config(config):
|
def create_config(config):
|
||||||
|
@ -30,7 +31,8 @@ def create_config(config):
|
||||||
|
|
||||||
def read_config():
|
def read_config():
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read_file(codecs.open("GeoffreyConfig.ini", "r", "utf8"))
|
path = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
config.read_file(codecs.open("{}/GeoffreyConfig.ini".format(path), "r", "utf8"))
|
||||||
|
|
||||||
if len(config.sections()) == 0:
|
if len(config.sections()) == 0:
|
||||||
create_config(config)
|
create_config(config)
|
||||||
|
|
Loading…
Reference in New Issue