You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
import os, sys, importlib, glob, inspect, itertools
|
|
|
|
class MediaCombinator():
|
|
|
|
IDENTIFIER = 'media'
|
|
|
|
def __init__(self, context = None):
|
|
self._context = context
|
|
self._logger = context['logger']
|
|
self._reportLogger = context['report_logger']
|
|
|
|
def getIdentifier(self):
|
|
return self._identifier
|
|
def getVariant(self):
|
|
return self._variant
|
|
|
|
@staticmethod
|
|
def list():
|
|
basePath = os.path.dirname(__file__)
|
|
return [os.path.basename(p)[17:-3]
|
|
for p
|
|
in glob.glob(f"{ basePath }/media_combinator_*.py", recursive = True)
|
|
if p != __file__]
|
|
|
|
@staticmethod
|
|
def getClassReference(identifier):
|
|
importlib.import_module(f"ffx.test.media_combinator_{ identifier }")
|
|
for name, obj in inspect.getmembers(sys.modules[f"ffx.test.media_combinator_{ identifier }"]):
|
|
#HINT: Excluding MediaCombinator as it seems to be included by import (?)
|
|
if inspect.isclass(obj) and name != 'MediaCombinator' and name.startswith('MediaCombinator'):
|
|
return obj
|
|
|
|
@staticmethod
|
|
def getAllClassReferences():
|
|
return [MediaCombinator.getClassReference(i) for i in MediaCombinator.list()]
|