[Mod] change working path when MainEngine created

This commit is contained in:
vn.py 2019-06-30 23:39:02 +08:00
parent 0be4db26c9
commit 4b1cd4d602

View File

@ -3,6 +3,7 @@
import logging import logging
import smtplib import smtplib
import os
from abc import ABC from abc import ABC
from datetime import datetime from datetime import datetime
from email.message import EmailMessage from email.message import EmailMessage
@ -30,7 +31,7 @@ from .object import (
HistoryRequest HistoryRequest
) )
from .setting import SETTINGS from .setting import SETTINGS
from .utility import get_folder_path from .utility import get_folder_path, TRADER_DIR
class MainEngine: class MainEngine:
@ -51,7 +52,8 @@ class MainEngine:
self.apps = {} self.apps = {}
self.exchanges = [] self.exchanges = []
self.init_engines() os.chdir(TRADER_DIR) # Change working directory
self.init_engines() # Initialize function engines
def add_engine(self, engine_class: Any): def add_engine(self, engine_class: Any):
""" """