Refactored the directory variables minimally
This commit is contained in:
parent
3f007cc83f
commit
b6c9d025a8
@ -16,14 +16,13 @@ import MySQLdb as mysql
|
|||||||
|
|
||||||
from matrix_bot_api.mregex_handler import MRegexHandler
|
from matrix_bot_api.mregex_handler import MRegexHandler
|
||||||
|
|
||||||
EVENTS_DATA_DIR = os.path.join(os.path.dirname(__file__),
|
MESSAGE_DIR = os.path.join(os.path.dirname(__file__), 'messages')
|
||||||
'../../data/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')
|
|
||||||
CONFIG_LOCATION = os.path.join(os.path.dirname(__file__), 'config.json')
|
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__),
|
DATA_LOCATION = DATA_DIR + '/data.db'
|
||||||
'messages/messages.dutch.json')
|
HELP_LOCATION = MESSAGE_DIR + '/help'
|
||||||
|
MESSAGES_LOCATION = MESSAGE_DIR + '/messages.dutch.json'
|
||||||
|
|
||||||
class Plugin:
|
class Plugin:
|
||||||
""" This plugin grabs events from Admidio (https://admidio.org)
|
""" This plugin grabs events from Admidio (https://admidio.org)
|
||||||
@ -248,7 +247,7 @@ def setup():
|
|||||||
SQLite tables."""
|
SQLite tables."""
|
||||||
|
|
||||||
# Try to make a new directory
|
# Try to make a new directory
|
||||||
os.mkdir(EVENTS_DATA_DIR)
|
os.mkdir(DATA_DIR)
|
||||||
|
|
||||||
# Define query to INSERT event table to SQLite DB
|
# Define query to INSERT event table to SQLite DB
|
||||||
sql = """CREATE TABLE 'events' (
|
sql = """CREATE TABLE 'events' (
|
||||||
|
Loading…
Reference in New Issue
Block a user