update path
Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
This commit is contained in:
@@ -3,6 +3,7 @@ import yaml
|
|||||||
import telegram
|
import telegram
|
||||||
import html
|
import html
|
||||||
import telegram.ext
|
import telegram.ext
|
||||||
|
import os
|
||||||
|
|
||||||
ITEM_HTML = """
|
ITEM_HTML = """
|
||||||
<b>Resultados para:</b> {search_name}
|
<b>Resultados para:</b> {search_name}
|
||||||
@@ -37,7 +38,8 @@ class TelegramManager:
|
|||||||
asyncio.set_event_loop(self._loop)
|
asyncio.set_event_loop(self._loop)
|
||||||
|
|
||||||
def get_config(self):
|
def get_config(self):
|
||||||
config_file = 'config.yaml'
|
base_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
config_file = os.path.join(base_dir, 'config.yaml')
|
||||||
with open(config_file, 'r') as file:
|
with open(config_file, 'r') as file:
|
||||||
config = yaml.safe_load(file)
|
config = yaml.safe_load(file)
|
||||||
token = config['telegram_token']
|
token = config['telegram_token']
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ def configure_logger():
|
|||||||
handlers=[console_handler, file_handler])
|
handlers=[console_handler, file_handler])
|
||||||
|
|
||||||
def parse_items_to_monitor():
|
def parse_items_to_monitor():
|
||||||
with open("workers.json") as f:
|
import os
|
||||||
|
base_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
workers_path = os.path.join(base_dir, "workers.json")
|
||||||
|
with open(workers_path) as f:
|
||||||
args = json.load(f)
|
args = json.load(f)
|
||||||
if 'items' not in args:
|
if 'items' not in args:
|
||||||
raise ValueError("Missing mandatory field: items")
|
raise ValueError("Missing mandatory field: items")
|
||||||
|
|||||||
Reference in New Issue
Block a user