コード例 #1
0
 def handle(self, element, module, function, immediate, dll):
     immediate = self.isTrue(immediate)
     func = BugUtil.getFunction(module, function, True, *element.args,
                                **element.kwargs)
     if immediate:
         func()
     else:
         BugInit.addInit(module, func)
コード例 #2
0
ファイル: BugConfig.py プロジェクト: keldath/kmod-adv-Doto
	def handle(self, element, module, function, immediate, dll):
		immediate = self.isTrue(immediate)
		dll = BugDll.decode(dll)
		if self.isDllOkay(element, dll):
			func = BugUtil.getFunction(module, function, True, *element.args, **element.kwargs)
			if immediate:
				func()
			else:
				BugInit.addInit(module, func)
		else:
			BugUtil.info("BugConfig - ignoring <%s> %s.%s, requires dll version %s", element.tag, module, function, self.resolveDll(element, dll))
コード例 #3
0
ファイル: BugConfig.py プロジェクト: AP-ML/DTM
	def handle(self, element, module, function, immediate, dll):
		immediate = self.isTrue(immediate)
		dll = BugDll.decode(dll)
		if self.isDllOkay(element, dll):
			func = BugUtil.getFunction(module, function, True, *element.args, **element.kwargs)
			if immediate:
				func()
			else:
				BugInit.addInit(module, func)
		else:
			BugUtil.info("BugConfig - ignoring <%s> %s.%s, requires dll version %s", element.tag, module, function, self.resolveDll(element, dll))
コード例 #4
0
def initBug():
	"""Called once after Civ has initialized its data structures."""
	global g_initDone
	if not g_initDone:
		import BugInit
		if BugInit.init():
			g_initDone = True
コード例 #5
0
def initAfterReload():
	"""
	Initialize BUG and fires PythonReloaded event after reloading Python modules while game is still running.
	
	The first time this module is loaded after the game launches, the global context is not yet ready,
	and thus BUG cannot be initialized. When the Python modules are reloaded after being changed, however,
	this will reinitialize BUG and the main interface.
	"""

	import BugInit
	if BugInit.init():
		try:
			import CvScreensInterface
			CvScreensInterface.reinitMainInterface()
		except:
			import BugUtil
			BugUtil.error("BugInit - failure rebuilding main interface after reloading Python modules")
		getEventManager().fireEvent("PythonReloaded")

	import CvMainInterface #added Sephi		
	mainInterface = CvMainInterface.CvMainInterface()		
	mainInterface.initState()
		
# initialize BUG after Python modules have been reloaded
	initAfterReload()
コード例 #6
0
ファイル: BugDll.py プロジェクト: AP-ML/DTM
def init():
	"""
	Checks for the presence of the BUG DLL and grabs its Python API version if found.
	"""
	try:
		if gc.isBull():
			global IS_PRESENT, VERSION
			IS_PRESENT = True
			VERSION = gc.getBullApiVersion()
			BugUtil.info("BugDll - %s %s, API version %d", gc.getBullName(), gc.getBullVersion(), VERSION)
			if hasattr(CyGlobalContext, "setIsBug"):
				import BugInit
				BugInit.addInit("setIsBug", setIsBug)
			else:
				BugUtil.debug("BugDll - setIsBug() not found")
	except:
		BugUtil.debug("BugDll - BULL not present")
コード例 #7
0
ファイル: BugDll.py プロジェクト: macaurther/DOCUSA
def init():
    """
	Checks for the presence of the BUG DLL and grabs its Python API version if found.
	"""
    try:
        if gc.isBull():
            global IS_PRESENT, VERSION
            IS_PRESENT = True
            VERSION = gc.getBullApiVersion()
            BugUtil.info("BugDll - %s %s, API version %d", gc.getBullName(),
                         gc.getBullVersion(), VERSION)
            if hasattr(CyGlobalContext, "setIsBug"):
                import BugInit
                BugInit.addInit("setIsBug", setIsBug)
            else:
                BugUtil.debug("BugDll - setIsBug() not found")
    except:
        BugUtil.debug("BugDll - BULL not present")
コード例 #8
0
def initAfterReload():
    """
	Initialize BUG and fires PythonReloaded event after reloading Python modules while game is still running.

	The first time this module is loaded after the game launches, the global context is not yet ready,
	and thus BUG cannot be initialized. When the Python modules are reloaded after being changed, however,
	this will reinitialize BUG and the main interface.
	"""
    import BugInit
    BugInit.init()
    try:
        import CvScreensInterface
        CvScreensInterface.reinitMainInterface()
    except:
        import BugUtil
        BugUtil.error(
            "BugInit - failure rebuilding main interface after reloading Python modules"
        )
    eventManager.fireEvent("PythonReloaded")
コード例 #9
0
	def _handleInitBugEvent(self, eventType, argsList):
		"""Initializes BUG before handling event normally.
		"""
		import BugInit
		BugInit.init()
		self._handleDefaultEvent(eventType, argsList)
コード例 #10
0
    def _handleInitBugEvent(self, eventType, argsList):
        """Initializes BUG before handling event normally.
		"""
        import BugInit
        BugInit.init()
        self._handleDefaultEvent(eventType, argsList)
コード例 #11
0
ファイル: BugConfig.py プロジェクト: keldath/kmod-adv-Doto
	def handle(self, element, name):
		BugUtil.debug("BugConfig - loading mod file %s", name)
		BugInit.loadMod(name)
コード例 #12
0
def forceBUGModuleInit(argsList):
    import BugInit
    BugInit.init()
コード例 #13
0
ファイル: BugConfig.py プロジェクト: AP-ML/DTM
	def handle(self, element, name):
		BugUtil.debug("BugConfig - loading mod file %s", name)
		BugInit.loadMod(name)
コード例 #14
0
ファイル: BugConfig.py プロジェクト: hardtimes1966/modxml
	def createInit(self, module, function="init", immediate=False, args=(), kwargs={}, attrs=None):
		func = BugUtil.getFunction(module, function, *args, **kwargs)
		if immediate:
			func()
		else:
			BugInit.addInit(module, func)
コード例 #15
0
ファイル: BugConfig.py プロジェクト: hardtimes1966/modxml
	def loadMod(self, name):
		BugInit.loadMod(name)