Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #try to import those and get the keys
- for engine in engines:
- try:
- print('Importing ... ' + engine)
- __import__('engines.' + engine, globals=globals(), level=-1)
- except Exception as e:
- print('File: %s: import error %s' %(engine, str(e)) )
- for klass in AbstractLookupEngine.__subclasses__():
- print('Creating instance of '+ str(klass.__name__))
- object = klass()
- print (dir(object))
- self.register_engine(object)
- def _find_all_engines(self):
- # get the file name of the all the .py files
- return [ x[:-3]
- for x in os.listdir(self._engines_dir)
- if x.endswith('.py') and not x in self._ignored_list ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement