1 Star 0 Fork 0

lysgwl/AppHelper

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
runmodule.py 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
lysgwl 提交于 2023-11-12 20:46 . 2023.11.12 20:45
# -*- coding: UTF-8 -*-
from config import ConfigModule
from appfactory import AppFactory
from processmgr import ProcessMgr
class RunModule:
def __init__(self, config):
self.config = config
self.factory = AppFactory.getInstance()
self.process = ProcessMgr()
def run(self, apptype):
try:
if apptype is not None:
app = self.factory.getAppModule(apptype)
if app is None:
return
command_tuple = app.get()
if len(command_tuple) > 0:
command_str = ' '.join(command_tuple)
self.process.start_process(self.config.system_type, command_str)
else:
applist = self.factory.getAppModule(None)
for app in applist:
if app is None:
continue
command_tuple = app.get()
if len(command_tuple) > 0:
command_str = ' '.join(command_tuple)
self.process.start_process(self.config.system_type, command_str)
self.process.wait_for_processes()
except Exception as e:
print("An error occurred in RunModule.run:", str(e))
def stop(self):
self.process.stop_processes()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/c95wl/app-helper.git
git@gitee.com:c95wl/app-helper.git
c95wl
app-helper
AppHelper
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385