add:初始化工程
This commit is contained in:
51
importResources.py
Normal file
51
importResources.py
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from import_files import import_dts_info_bytimes, importXmlFromConfig
|
||||
|
||||
class SysStatus(Enum):
|
||||
INIT = "init"
|
||||
RUNNING = "running"
|
||||
BUSY = "busy"
|
||||
ERROR = "error"
|
||||
STOPPED = "stopped"
|
||||
|
||||
|
||||
class ImportSources:
|
||||
def __init__(self):
|
||||
self.status = SysStatus.INIT # 初始化状态
|
||||
|
||||
def set_status(self, status):
|
||||
self.status = status
|
||||
self.info = 'ready..\n'
|
||||
|
||||
def get_info(self):
|
||||
return self.info
|
||||
|
||||
def reset_inof(self):
|
||||
self.info = 'ready...\n'
|
||||
|
||||
def append_info(self, text):
|
||||
self.info = self.info + text + '\n'
|
||||
|
||||
def get_status(self):
|
||||
return self.status
|
||||
|
||||
def update_table_enabled(self,json_file_path, table_name, enable_value):
|
||||
importXmlFromConfig.update_table_enabled(json_file_path, table_name, enable_value)
|
||||
|
||||
def import_dts_data(self, dts_path='E:\\sesCode\dts\\'):
|
||||
self.set_status(SysStatus.RUNNING)
|
||||
import_dts_info_bytimes.import_dts_info(dts_path)
|
||||
self.set_status(SysStatus.STOPPED)
|
||||
|
||||
def import_xml_data(self, uf20_path='D:\\Sources\\经纪业务运营平台V21\\', uft30_path='F:\\sesCode\\'):
|
||||
importXmlFromConfig.import_xml_from_config(uf20_path, uft30_path)
|
||||
|
||||
# 示例用法
|
||||
if __name__ == "__main__":
|
||||
importSources = ImportSources()
|
||||
importSources.import_dts_data()
|
||||
importSources.import_xml_data()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user