Пример #1
0
 def get(self):
     profile = ProxyProfile.instance().profile
     if profile:
         self.write(profile)
     else:
         self.set_status(500)
         self.write('invalid profile, please set again')
Пример #2
0
 def get(self):
     start = int(self.get_argument('start', 0))
     limit = int(self.get_argument('limit', 20))
     profile = ProxyProfile.instance().profile
     resp = db_api.get_conversations(profile, start, limit)
     start = resp[-1]['id'] if resp else start
     self.write(dict(num=len(resp), start=start, data=resp))
Пример #3
0
 def post(self, profile_id):
     instance = ProxyProfile.instance()
     profile = instance.load(profile_id)
     if profile:
         self.write(profile)
     else:
         self.set_status(500)
         self.write('invalid profile, please set again')
Пример #4
0
def init_app():
    db_api.init()
    from devsniff.proxy import ProxyProfile
    ProxyProfile.instance().load(1)