def initialize(probePaths = ["../plugins/probes"], codecPaths = ["../plugins/codecs"]): # CodecManager logging diversion CodecManager.instance().setLogCallback(logging.getLogger("Agent.Codec").debug) # ProbeImplementationManager logging diversion ProbeImplementationManager.setLogger(logging.getLogger("Agent.Probe")) # Loading plugins: probes & codecs localPath = os.path.normpath(os.path.realpath(os.path.dirname(sys.modules[globals()['__name__']].__file__))) scanPlugins([ ((os.path.isabs(x) and x) or os.path.normpath(os.path.realpath('%s/%s' % (os.getcwd(), x)))) for x in codecPaths], label = "codec") scanPlugins([ ((os.path.isabs(x) and x) or os.path.normpath(os.path.realpath('%s/%s' % (os.getcwd(), x)))) for x in probePaths], label = "probe")
def instance(): return CodecManager.instance()
# This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. ## ## # Codec manager - view from the TE ## import CodecManager import TestermanTCI from CodecManager import CodecNotFoundException CodecManager.instance().setLogCallback( lambda x: TestermanTCI.logInternal("CD: %s" % x)) def instance(): return CodecManager.instance() def alias(name, codec, **kwargs): return instance().alias(name, codec, **kwargs) def registerCodecClass(name, class_): return instance().registerCodecClass(name, class_) def encode(name, template):
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. ## ## # Codec manager - view from the TE ## import CodecManager import TestermanTCI from CodecManager import CodecNotFoundException CodecManager.instance().setLogCallback(lambda x: TestermanTCI.logInternal("CD: %s" % x)) def instance(): return CodecManager.instance() def alias(name, codec, **kwargs): return instance().alias(name, codec, **kwargs) def registerCodecClass(name, class_): return instance().registerCodecClass(name, class_) def encode(name, template): return instance().encode(name, template) def decode(name, data): return instance().decode(name, data)