Exemplo n.º 1
0
 def testCreatescriptlist(self):
     j = es.createscriptlist()
     self.failUnless(j and len(j))
     j = es.createscriptlist("xxxxxxxxlarry")
     self.failIf(j or len(j))
     j = es.createscriptlist('corelib')
     self.failUnless(len(j)==1)
Exemplo n.º 2
0
 def testCreatescriptlist(self):
     j = es.createscriptlist()
     self.failUnless(j and len(j))
     j = es.createscriptlist("xxxxxxxxlarry")
     self.failIf(j or len(j))
     j = es.createscriptlist('corelib')
     self.failUnless(len(j) == 1)
Exemplo n.º 3
0
   def _getAddonSet(self):
      """ Returns a set of all ESS and ESP addons """
      addon_list = set(es.createscriptlist())

      for addon in es.addons.getAddonList():
         addon_list.add(addon.__name__[:addon.__name__.rfind('.')].replace('.', '/'))

      return addon_list
Exemplo n.º 4
0
def increment(addon):
	"""
	Increases the reference count of an addon by one.
	"""
	count = 1
	if _addons.has_key(addon):
		_addons[addon]["count"] += 1
		count = _addons[addon]["count"]
	else:
		_addons[addon]["count"] = 1
		es.createscriptlist("_refcount_scripts")
		_addons[addon]["oldValue"] = es.exists("key", "_refcount_scripts", addon)
		es.keygroupdelete("_refcount_scripts")

	# Load the addon.
	es.load(addon)

	es.dbgmsg(1, 'refcount: Addon "%s" has a reference count of "%d".' % (addon, count))
Exemplo n.º 5
0
def createscriptlist(argv):
  result = es.createscriptlist(*argv[1:])
  if result is None:
    return
    
  dict_to_keyvalues(argv[0], result)