-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
125 changed files
with
7,216 additions
and
3,774 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
import glob | ||
import inspect | ||
import os | ||
modules = glob.glob(os.path.dirname(__file__)+"/*.py" ) | ||
__all__ = [ os.path.basename(f)[:-3] for f in modules if not f.endswith('__init__.py')] | ||
|
||
|
||
def is_valid(module): | ||
''' This function attempts to import the applications in order to detect | ||
errors in their implementation . After they are imported, they are garbage collected | ||
when the function returns.''' | ||
try: | ||
_ = __import__(module, globals(), locals()) | ||
return True | ||
except Exception as e: | ||
print( | ||
"Ignoring application '{}'. Failed to load with: ".format(module)) | ||
print(e) | ||
return False | ||
|
||
|
||
modules = glob.glob(os.path.dirname(__file__) + "/*.py") | ||
# only valid applications will be added to the list | ||
__all__ = [ | ||
os.path.basename(f)[:-3] for f in modules if (not f.endswith('__init__.py') and is_valid(os.path.basename(f)[:-3])) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.