Refactored the directory variables minimally

This commit is contained in:
Dennis Potter 2019-01-13 12:51:57 +01:00
parent 3f007cc83f
commit b6c9d025a8
1 changed files with 7 additions and 8 deletions

View File

@ -16,14 +16,13 @@ import MySQLdb as mysql
from matrix_bot_api.mregex_handler import MRegexHandler
EVENTS_DATA_DIR = os.path.join(os.path.dirname(__file__),
'../../data/events')
DATA_LOCATION = os.path.join(os.path.dirname(__file__),
'../../data/events/data.db')
MESSAGE_DIR = os.path.join(os.path.dirname(__file__), 'messages')
DATA_DIR = os.path.join(os.path.dirname(__file__),'../../data/events')
CONFIG_LOCATION = os.path.join(os.path.dirname(__file__), 'config.json')
HELP_LOCATION = os.path.join(os.path.dirname(__file__), 'messages/help')
MESSAGES_LOCATION = os.path.join(os.path.dirname(__file__),
'messages/messages.dutch.json')
DATA_LOCATION = DATA_DIR + '/data.db'
HELP_LOCATION = MESSAGE_DIR + '/help'
MESSAGES_LOCATION = MESSAGE_DIR + '/messages.dutch.json'
class Plugin:
""" This plugin grabs events from Admidio (https://admidio.org)
@ -248,7 +247,7 @@ def setup():
SQLite tables."""
# Try to make a new directory
os.mkdir(EVENTS_DATA_DIR)
os.mkdir(DATA_DIR)
# Define query to INSERT event table to SQLite DB
sql = """CREATE TABLE 'events' (