Beispiel #1
0
 def fetch(self, manager, psuser_id, date_obj):
     mycust = MyCustomersInterface.get_data(manager, psuser_id, date_obj)
     sub_list = mycust['ztc_sub'] if mycust and 'ztc_sub' in mycust else []
     result = self.aggregate(sub_list)
     _data = {self.details: sub_list, self.name: result}
     manager.feed_data(psuser_id, date_obj, _data)
     return result
Beispiel #2
0
 def fetch(self, manager, psuser_id, date_obj):
     mycust = MyCustomersInterface.get_data(manager, psuser_id, date_obj)
     sub_list = mycust.get('serving_sub_list', []) + mycust.get(
         'pause_sub', []) + mycust.get('unsub_sub', []) if mycust else []
     result = self.aggregate(sub_list)
     _data = {self.details: sub_list, self.name: result}
     manager.feed_data(psuser_id, date_obj, _data)
     return result
Beispiel #3
0
 def snapshot(self, manager, psuser_id, date_obj):
     MyCustomersInterface.get_new_cust_sub(manager, psuser_id, date_obj)
Beispiel #4
0
 def snapshot_data(self):
     """将数据写入快照"""
     self.metric_list = self.METRIC_DICT.values()
     self.metric_list.sort(lambda x, y: cmp(x.snapshot_order, y.snapshot_order))
     self.__handle_data('snapshot')
     MyCustomersInterface.store_data(self)