mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-09-11 11:51:01 +08:00
Class attachments working
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
active_modules = ["text", "images"]
|
||||||
Reference in New Issue
Block a user