Fixed config file paths
This commit is contained in:
parent
bc68523d38
commit
8e2cee90b7
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import threading
|
import threading
|
||||||
from os import wait, read
|
from os import wait, read
|
||||||
|
import os.path
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import socket
|
import socket
|
||||||
@ -15,13 +16,18 @@ import logging.config
|
|||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
from pynput.keyboard import Listener, Key
|
from pynput.keyboard import Listener, Key
|
||||||
|
|
||||||
|
SCRIPT_DIR = os.path.dirname(__file__)
|
||||||
|
|
||||||
config_object = ConfigParser()
|
config_object = ConfigParser()
|
||||||
config_object.read('config.ini')
|
config_object.read(os.path.join(SCRIPT_DIR, 'config.ini'))
|
||||||
config = config_object['DEFAULT']
|
config = config_object['DEFAULT']
|
||||||
|
|
||||||
# TODO: export these to json?
|
# TODO: export these to json?
|
||||||
# Config file name
|
# Config file name
|
||||||
CONFIG_FILE = 'path.xlsx'
|
#CONFIG_FILE = 'path.xlsx'
|
||||||
|
|
||||||
|
CONFIG_FILE = os.path.join(SCRIPT_DIR, "path.xlsx")
|
||||||
|
|
||||||
CONFIG_FILE_SHEET_NAME = 'Configurations'
|
CONFIG_FILE_SHEET_NAME = 'Configurations'
|
||||||
CONFIG_FILE_SHEET_MASTER = 'M'
|
CONFIG_FILE_SHEET_MASTER = 'M'
|
||||||
CONFIG_FILE_SHEET_SLAVE = 'S'
|
CONFIG_FILE_SHEET_SLAVE = 'S'
|
||||||
@ -813,7 +819,7 @@ def slave_thread(sync_event, path):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
logging.config.fileConfig('log_config.ini')
|
logging.config.fileConfig(os.path.join(SCRIPT_DIR, 'log_config.ini'))
|
||||||
|
|
||||||
if config['EXECUTION'] == 'SLOW':
|
if config['EXECUTION'] == 'SLOW':
|
||||||
j_speed = config.getfloat('J_SPEED_SLOW')
|
j_speed = config.getfloat('J_SPEED_SLOW')
|
||||||
|
Loading…
Reference in New Issue
Block a user