Files
XBMC4Xbox/system/python/spyce/spyceModule.py
T
Rocky5 921f9fe9f8 Clean Copy
If ever adding the XBMC4Xbox source to GitHub use "git add -f -A" or it wont add all the files.
2024-01-08 19:01:29 +00:00

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',
]