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