datacollect/cron/init_first_ad_channel.py
2019-09-04 17:39:23 +08:00

34 lines
811 B
Python

# -*- coding: utf-8 -*-
from ops.mtga import FromTga, GetTgaConfig
from ops.plog import define_logger
import logging
define_logger("/data/logs/init_first_ad_channel.log")
log = logging.getLogger(__name__)
class InitFirstAD():
def __init__(self, kwargs):
self.date = kwargs.get('date')
self.gameid = kwargs.get('gameid')
self.channelid = kwargs.get('channelid')
g = GetTgaConfig()
item = g.get_api_key(self.gameid)
self.url = item['url']
self.tgaid = item['tgaid']
self.suffix = item.get('suffix', 0)
self.api_key = item.get('api_key', None)
self.tga = FromTga(self.url, self.api_key)
self.tga.init_tga_write(self.tgaid)
def run(self):
pass
def main():
pass
if __name__ == "__main__":
main()