代码拉取完成,页面将自动刷新
同步操作将从 SleepySoft/StockAnalysisSystem 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import os
import sys
import traceback
from PyQt5.QtWidgets import QApplication
from StockAnalysisSystem.ui.main_ui import MainWindow
from StockAnalysisSystem.ui.Utility.ui_context import UiContext
from StockAnalysisSystem.core.Utility.ui_utility import WrapperQDialog
from StockAnalysisSystem.ui.if_selector_ui import InterfaceSelectUi
from StockAnalysisSystem.interface.interface_rest import RestInterface
from StockAnalysisSystem.interface.interface_local import LocalInterface
from StockAnalysisSystem.interface.interface import SasInterface as sasIF
def init_if(local: bool = True, local_project_path: str = '',
remote_url: str = 'http://127.0.0.1:80/api', remote_token: str = '') -> sasIF or None:
if local:
if local_project_path is None or local_project_path == '':
local_project_path = os.getcwd()
local_if = LocalInterface()
local_if.if_init(local_project_path)
return local_if
else:
remote_if = RestInterface()
remote_if.if_init(api_uri=remote_url, token=remote_token)
return remote_if
def main():
app = QApplication(sys.argv)
if_sel_ui = InterfaceSelectUi()
dlg = WrapperQDialog(if_sel_ui)
dlg.exec()
if not if_sel_ui.is_ok():
exit(0)
is_local = if_sel_ui.is_local()
url, port = if_sel_ui.get_remote_host_config()
user, passwd, token = if_sel_ui.get_remote_host_authentication()
sasif = init_if(is_local, remote_url=url, remote_token=token)
prob = sasif.sas_service_prob()
if prob is None:
print('Interface access FAIL. Quit.')
exit(1)
ui_ctx = UiContext()
ui_ctx.set_sas_interface(sasif)
main_wnd = MainWindow(ui_ctx)
main_wnd.show()
sys.exit(app.exec())
print('Process Quit.')
# ----------------------------------------------------------------------------------------------------------------------
def exception_hook(_type, value, tback):
# log the exception here
print('Exception hook triggered.')
print(_type)
print(value)
print(tback)
# then call the default handler
sys.__excepthook__(_type, value, tback)
if __name__ == "__main__":
sys.excepthook = exception_hook
try:
main()
except Exception as e:
print('Error =>', e)
print('Error =>', traceback.format_exc())
exit()
finally:
pass
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。