mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-03 04:17:58 +08:00
update
This commit is contained in:
parent
8ee26edf96
commit
f4d0ada177
@ -200,7 +200,9 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
||||
return
|
||||
|
||||
#普通日志输出控制台
|
||||
con = logging.StreamHandler(EmittingStream(textWritten=self.normalOutputWritten))
|
||||
if self._stream is None:
|
||||
self._stream = EmittingStream(textWritten=self.normalOutputWritten)
|
||||
con = logging.StreamHandler(self._stream)
|
||||
FORMAT = logging.Formatter(
|
||||
'%(asctime)-15s [%(levelname)s] - %(message)s [%(name)s::%(funcName)s]'
|
||||
)
|
||||
@ -218,10 +220,12 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
||||
hku_logger.addHandler(con)
|
||||
|
||||
def initUI(self):
|
||||
self._stream = None
|
||||
if self._capture_output:
|
||||
stream = EmittingStream(textWritten=self.normalOutputWritten)
|
||||
sys.stdout = stream
|
||||
sys.stderr = stream
|
||||
self._stream = EmittingStream(textWritten=self.normalOutputWritten)
|
||||
if self._stream is not None:
|
||||
sys.stdout = self._stream
|
||||
sys.stderr = self._stream
|
||||
self.log_textEdit.document().setMaximumBlockCount(1000)
|
||||
|
||||
current_dir = os.path.dirname(__file__)
|
||||
@ -736,6 +740,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
||||
if self.collect_spot_thread is not None and self.collect_spot_thread.isRunning():
|
||||
self.collect_spot_thread.terminate()
|
||||
self.collect_spot_thread.wait()
|
||||
self.logger.info("停止采集")
|
||||
QMessageBox.about(self, '', '已停止')
|
||||
|
||||
|
||||
|
@ -203,8 +203,6 @@ def collect(use_proxy, source, seconds, phase1, phase2, ignore_weekend):
|
||||
|
||||
hikyuu_init(config_file, ignore_preload=True)
|
||||
|
||||
print("采集程序运行中,可使用 Ctrl-C 终止!")
|
||||
|
||||
sm = StockManager.instance()
|
||||
stk_list = [
|
||||
stk.market_code.lower() for stk in sm if stk.valid and stk.type in
|
||||
@ -266,6 +264,7 @@ def run(use_proxy, source, seconds, phase1, phase2, ignore_weekend):
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
print("采集程序运行中,可使用 Ctrl-C 终止!")
|
||||
run()
|
||||
except KeyboardInterrupt:
|
||||
exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user