def __init__(self, mapName): self.data = {} self.tmpdata = None path = FileUtils.getRealPluginPath('Builder_plugin') path = os.path.join(path, 'service') path = os.path.join(path, 'dist') path = os.path.join(path, 'generic_instance_manager.exe') f = FrontEndJsonCallback([path]) f.run() path = FileUtils.getRealPluginPath('Builder_plugin') path = os.path.join(path, 'maps') if not os.path.exists(path): os.makedirs(path) path = os.path.join(path, mapName + '.db') self.db = DBStub(f, path, 'models', self.__onInited)
def __init__(self, mapName): self.data = {} self.tmpdata = None path = FileUtils.getRealPluginPath('Builder') path = os.path.join(path, 'service') path = os.path.join(path, 'dist') path = os.path.join(path, 'generic_instance_manager.exe') f = FrontEndJsonCallback([path]) f.run() path = FileUtils.getRealPluginPath('Builder') path = os.path.join(path, 'maps') if not os.path.exists(path): os.makedirs(path) path = os.path.join(path, mapName + '.db') self.db = DBStub(f, path, 'models', self.__onInited) return
def extract(self, zip_path='res/packages/shared_content.pkg', path='content/Railway/rw012_MechSemafor/', output='models'): temp_dir = os.path.join(FileUtils.getRealPluginPath('Builder_plugin'), output) with ZipFile(zip_path, 'r') as zip_file: members = zip_file.namelist() members_to_extract = [m for m in members if m.startswith(path)] zip_file.extractall(temp_dir, members_to_extract)
def readConfig(cls): super(SixthSenseDuration, SixthSenseDuration).readConfig() wotv = FileUtils.getWotVersion() tmp = [] for d in SixthSenseDuration.myConf['AudioExternal']: tmp.append(d.replace('{v}',wotv)) SixthSenseDuration.myConf['AudioExternal'] = tmp SixthSenseDuration.myConf['IconInactivePath'] = SixthSenseDuration.myConf['IconInactivePath'].replace('{v}',wotv) SixthSenseDuration.myConf['IconUnspottedPath'] = SixthSenseDuration.myConf['IconUnspottedPath'].replace('{v}',wotv) SixthSenseDuration.myConf['IconSpottedPath'] = SixthSenseDuration.myConf['IconSpottedPath'].replace('{v}',wotv)
def readConfig(cls): super(SixthSenseDuration, SixthSenseDuration).readConfig() wotv = FileUtils.getWotVersion() tmp = [] for d in SixthSenseDuration.myConf['AudioExternal']: tmp.append(d.replace('{v}', wotv)) SixthSenseDuration.myConf['AudioExternal'] = tmp SixthSenseDuration.myConf[ 'IconInactivePath'] = SixthSenseDuration.myConf[ 'IconInactivePath'].replace('{v}', wotv) SixthSenseDuration.myConf[ 'IconUnspottedPath'] = SixthSenseDuration.myConf[ 'IconUnspottedPath'].replace('{v}', wotv) SixthSenseDuration.myConf[ 'IconSpottedPath'] = SixthSenseDuration.myConf[ 'IconSpottedPath'].replace('{v}', wotv)
def readConfig(self): SpotMessanger.myconfig = FileUtils.readConfig('scripts/client/plugins/SpotMessanger_plugin/config.xml',SpotMessanger.myconfig,"SpotMessanger") SpotMessanger.myconfig['ActivationHotkey'] = HotKeysUtils.parseHotkeys(SpotMessanger.myconfig['ActivationHotkey']) SpotMessanger.isActive = SpotMessanger.myconfig['ActiveByDefault'] self.pluginEnable = SpotMessanger.myconfig['pluginEnable']
import os import imp import sys import importlib import traceback from plugins.Engine.ModUtils import FileUtils from debug_utils import LOG_ERROR, LOG_CURRENT_EXCEPTION, LOG_DEBUG, LOG_NOTE,LOG_WARNING PluginFolder = FileUtils.getRealPluginsPath() def getPlugins(): plugins = [] sys.path.append(PluginFolder) possibleplugins = os.listdir(PluginFolder) for i in possibleplugins: location = os.path.join(PluginFolder, i) if not os.path.isdir(location) or i == "Engine": continue plugins.append(i) return plugins def loadPlugin(i): try: module = __import__(i) my_class = getattr(module, i.replace("_plugin","")) plugin = my_class() plugin.readConfig() if plugin.pluginEnable: print "---> Loading "+i plugin.run() except:
def extract(self, zip_path = 'res/packages/shared_content.pkg', path = 'content/Railway/rw012_MechSemafor/', output = 'models'): temp_dir = os.path.join(FileUtils.getRealPluginPath('Builder_plugin'), output) with ZipFile(zip_path, 'r') as zip_file: members = zip_file.namelist() members_to_extract = [ m for m in members if m.startswith(path) ] zip_file.extractall(temp_dir, members_to_extract)
def readConfig(self): IngameMessanger.myconfig = FileUtils.readConfig('scripts/client/plugins/IngameMessanger_plugin/config.xml',IngameMessanger.myconfig,"IngameMenssanger")
def readConfig(self): Builder.myconfig = FileUtils.readConfig('scripts/client/plugins/Builder_plugin/config.xml',Builder.myconfig,"Builder") self.pluginEnable = Builder.myconfig['pluginEnable']