Пример #1
0
	def load (self, path, name, klass):
		# Aggiungiamo la path
		old = sys.path
		sys.path.append (path)
		
			#utils.c_warn ("Carico il modulo senza try/except.. fixami prima della revisione finale")
		try:
			module = __import__ (name)#, globals (), locals (), [klass])
			instance = vars(module)[klass]

			for i in self.array:
				if i.__class__ == instance:
					return False
			
			plugin = instance ()
			
			# Roba di preferenze... raccomandati di merda -.- gh
			
			for i in plugin.__preferences__:
				ret = impostazioni.get (i)
				
				if ret == None:
					impostazioni.set (i, plugin.__preferences__[i])
				else:
					if type (ret) == type (plugin.__preferences__[i]):
						plugin.__preferences__[i] = ret
			
			plugin.start ()
			
			self.array.append (plugin)
			
			sys.path = old

			return True
		except:
			utils.c_warn ("Restoring path")
			sys.path = old

			utils.c_error ("!! %s::%s (%s)" % (klass, sys.exc_value, sys.exc_type))
			return False
Пример #2
0
	def _set_store (self, x):
		utils.c_warn ("_set_store () called ... why?")
Пример #3
0
	def _set_page_obj (self, x):
		utils.c_warn ("_set_page_obj () called ... why?")
Пример #4
0
	def _set_filt (self, x):
		utils.c_warn ("_set_filt () called ... why?")
Пример #5
0
	def _set_menu (self, x):
		utils.c_warn ("_set_menu () called ... why?")
Пример #6
0
	def _set_vars (self, x):
		utils.c_warn ("_set_vars () called ... why?")
Пример #7
0
	def _set_view (self, x):
		utils.c_warn ("_set_view () called ... why?")