示例#1
0
文件: adbs.py 项目: pastebt/yeast
class DBClt(object):
    def __init__(self):
        self.afunc = None

    def connect(self, dbsvr):
        self.dbsvr = dbsvr
        self.db_result = None
        self.afunc = AFunc(self.dbsvr.start)
        self.afunc.start()
        return self

    def _call_(self, func_name, *args, **keywords):
        msg = pickle.dumps({'name': func_name, 'args': args,
                            'keywords': keywords})
        for y in self.afunc.call(msg):
            yield y
        self.db_result = pickle.loads(self.afunc.func_ret)

    def __getattr__(self, name):
        return functools.partial(self._call_, name)
示例#2
0
文件: adbs.py 项目: pastebt/yeast
 def connect(self, dbsvr):
     self.dbsvr = dbsvr
     self.db_result = None
     self.afunc = AFunc(self.dbsvr.start)
     self.afunc.start()
     return self