diff --git a/IndicoIo/__init__.py b/IndicoIo/__init__.py index e69de29..c73fc5b 100644 --- a/IndicoIo/__init__.py +++ b/IndicoIo/__init__.py @@ -0,0 +1,17 @@ +import os, pkgutil, imp + +from config import active_modules + +API_KEY = os.environ["INDICO_API_KEY"] or None + +API_KEY = open("$HOME/.indico").read() or None + +class Indico(object): + + def __init__(api_key = API_KEY): + self.API_KEY = API_KEY + + for module in active_modules: + actual_module = imp.new_module(module) + for _, name, _ in pkgutil.iter_modules([module]): + setattr(self, name, getattr(actual_module, name)) diff --git a/IndicoIo/conf.py b/IndicoIo/conf.py new file mode 100644 index 0000000..da9f382 --- /dev/null +++ b/IndicoIo/conf.py @@ -0,0 +1 @@ +active_modules = ["text", "images"] diff --git a/IndicoIo/examples/__init__.py b/IndicoIo/examples/__init__.py new file mode 100644 index 0000000..e69de29