mirror of
https://github.com/Team-Resurgent/XBMC4Xbox.git
synced 2026-08-15 11:18:13 -07:00
If ever adding the XBMC4Xbox source to GitHub use "git add -f -A" or it wont add all the files.
56 lines
1.5 KiB
Python
56 lines
1.5 KiB
Python
##################################################
|
|
# SPYCE - Python-based HTML Scripting
|
|
# Copyright (c) 2002 Rimon Barr.
|
|
#
|
|
# Refer to spyce.py
|
|
# CVS: $Id: spyceModule.py 31144 2012-07-15 15:38:56Z buzz $
|
|
##################################################
|
|
|
|
__doc__ = '''Spyce modules functionality.'''
|
|
|
|
##################################################
|
|
# Spyce module
|
|
#
|
|
|
|
class spyceModule:
|
|
"All Spyce module should subclass this."
|
|
def __init__(self, wrapper):
|
|
self._api = wrapper
|
|
def start(self):
|
|
pass
|
|
def finish(self, theError=None):
|
|
pass
|
|
def init(self, *args, **kwargs):
|
|
pass
|
|
def __repr__(self):
|
|
return 'no information, '+str(self.__class__)
|
|
|
|
class spyceModulePlus(spyceModule):
|
|
def __init__(self, wrapper):
|
|
spyceModule.__init__(self, wrapper)
|
|
self.wrapper = self._api # deprecated
|
|
self.modules = moduleFinder(wrapper)
|
|
self.globals = wrapper.getGlobals()
|
|
|
|
class moduleFinder:
|
|
def __init__(self, wrapper):
|
|
self._wrapper = wrapper
|
|
def __getattr__(self, name):
|
|
return self._wrapper.getModule(name)
|
|
|
|
##################################################
|
|
# Spyce module API
|
|
#
|
|
|
|
spyceModuleAPI = [ 'getFilename', 'getCode',
|
|
'getCodeRefs', 'getModRefs',
|
|
'getServerObject', 'getServerGlobals', 'getServerID',
|
|
'getModules', 'getModule', 'setModule', 'getGlobals',
|
|
'registerModuleCallback', 'unregisterModuleCallback',
|
|
'getRequest', 'getResponse', 'setResponse',
|
|
'registerResponseCallback', 'unregisterResponseCallback',
|
|
'spyceString', 'spyceFile', 'spyceModule', 'spyceTaglib',
|
|
'setStdout', 'getStdout',
|
|
]
|
|
|