Exemplo n.º 1
0
def loadPlugins():
	plugins.clear()
	logging.info('Loading plugins...')
	for path in paths:
		files = os.listdir(path)
		for file in files:
			dirpath = path + '/' + file
			config_path = dirpath + '/' + config_filename
			if os.path.isdir(dirpath) and os.path.exists(config_path):
				p = Plugin(dirpath, config_path)
				if (p.isclientenabled and sauerbomber.isClient()) or (p.isserverenabled and sauerbomber.isServer()):
					plugins[p.name] = p
				else:
					logging.info('Skipping %s plugin' % file)
	logging.info('Found %i plugins' % len(plugins.keys()))
	logging.info('Initializing plugins...')
	for plugin in plugins.values():
		plugin.loadModule()
Exemplo n.º 2
0
	def unloadModule(self):
		if (self.isclientenabled and sauerbomber.isClient()) or (self.isserverenabled and sauerbomber.isServer()):
			del self.module
Exemplo n.º 3
0
	def loadModule(self):
		if self.initmodule and ((self.isclientenabled and sauerbomber.isClient()) or (self.isserverenabled and sauerbomber.isServer())) :
			self.module = __import__(os.path.basename(self.path) + '.' + self.initmodule)