mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-07-14 01:10:35 +08:00
got rid of old file
This commit is contained in:
@@ -1,11 +1,30 @@
|
||||
import os, pkgutil, imp
|
||||
|
||||
import inspect
|
||||
|
||||
from config import active_modules
|
||||
|
||||
API_KEY = os.environ["INDICO_API_KEY"] or None
|
||||
|
||||
API_KEY = open("$HOME/.indico").read() or None
|
||||
|
||||
|
||||
class PostApiKey(object):
|
||||
|
||||
def __init__(self, api_key):
|
||||
self.func = func
|
||||
self.api_key = api_key
|
||||
|
||||
def __call__(self, f):
|
||||
|
||||
def use_api_key(cls):
|
||||
for name, func in inspect.getmembers(cls):
|
||||
if inspect.ismethod(func) and not inspect.isclass(func.im_self):
|
||||
setattr(cls, name, PostApiKey(func, cls.API_KEY))
|
||||
return cls
|
||||
|
||||
|
||||
@use_api_key
|
||||
class Indico(object):
|
||||
|
||||
def __init__(api_key = API_KEY):
|
||||
|
||||
Reference in New Issue
Block a user