Пример #1
0
 def __init__(self, account_id=None, credentials=None):
     self.account_id = account_id if account_id else 'pub-5233202974419683'
     self.client_id = Config.getParam('adsense', 'client_id')
     self.client_secret = Config.getParam('adsense', 'client_secret')
     self.scope = 'https://www.googleapis.com/auth/adsense.readonly'
     self.credentials_file = \
     credentials if credentials else self.getCurrentFilePath('data/credentials.dat')
     self.stream_logger = StreamLogger.getLogger(__name__)
Пример #2
0
 def _connect_mysql(self):
     self.mysql_db = MySQLdb.connect(
             host = Config.getParam('mysql', 'host'),
             user = Config.getParam('mysql', 'user'),
             passwd = Config.getParam('mysql', 'password'),
             db = Config.getParam('mysql', 'db'),
             cursorclass=MySQLdb.cursors.DictCursor)
     return self.mysql_db
Пример #3
0
 def __init__(self, account_id=None, credentials=None):
     super().__init__()
     self.account_id =  account_id if account_id else 'pub-2500372977609723' 
     self.client_id =  Config.getParam('adx', 'client_id')
     self.client_secret = Config.getParam('adx', 'client_secret')
     self.scope='https://www.googleapis.com/auth/adexchange.seller.readonly'
     self.credentials_file = \
     credentials if credentials else self.getCurrentFilePath('data/adx_credentials.json')
Пример #4
0
 def __init__(self, collection=None):
     self.host = Config.getParam('mongo', 'host')
     self.user = Config.getParam('mongo', 'user')
     self.password = Config.getParam('mongo', 'password')
     self.db = Config.getParam('mongo', 'db')
     self.port = Config.getParam('mongo', 'port')
     self.mongo_conn = MongoClient(self.host, int(self.port))
     self.mongo_db = getattr(self.mongo_conn, self.db)
     self.collection = collection
Пример #5
0
    def __init__(self):
        self.stream_logger = StreamLogger.getLogger(__name__)
        self.gmail = Config.getParam('rubicon', 'gmail')
        self.username = Config.getParam('rubicon', 'username')
        self.password = Config.getParam('rubicon', 'password')
        self.client_id = Config.getParam('rubicon', 'gmail_client_id')
        self.client_secret = Config.getParam('rubicon', 'gmail_client_secret')
        self.scope = 'https://www.googleapis.com/auth/gmail.readonly'
        self.credentials_file = self.getCurrentFilePath(
            'data/gmail_credentials.json')

        store = file.Storage(self.credentials_file)
        creds = store.get()
        if not creds or creds.invalid:
            flow = client.flow_from_clientsecrets(self.credentials_file,
                                                  self.scope)
            creds = tools.run_flow(flow, store)
        self.mail_connection = build('gmail',
                                     'v1',
                                     http=creds.authorize(Http()))
Пример #6
0
    def __init__(self):
        self.stream_logger = StreamLogger.getLogger(__name__)
        self.host = Config.getParam('agora', 'ssh_host')
        self.user = Config.getParam('agora', 'ssh_user')
        self.password = Config.getParam('agora', 'ssh_pass')
        self.db_host = Config.getParam('agora', 'db_host')
        self.db_user = Config.getParam('agora', 'db_user')
        self.db_password = Config.getParam('agora', 'db_pass')
        self.db_name = Config.getParam('agora', 'db_name')

        self.client = paramiko.SSHClient()
        self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        # Update live agora server
        self.client.connect(
            hostname=self.host,
            port=22,
            username=self.user,
            password=self.password,
        )
        self.mysql_prefix = 'mysql -u %s -p%s %s ' % (
            self.db_user, self.db_password, self.db_name)
        # Make temporary directory
        self.tmp_dir = self.do_cmd('mktemp -d').strip()
Пример #7
0
 def __init__(self, data, datefield):
     self.api_uri = Config.getParam('currency', 'api_uri')
     self.__data = data
     self.__datefield = datefield
     self.__rates = {}
Пример #8
0
 def __init__(self):
     self.username = Config.getParam('pubmatic', 'username')
     self.password = Config.getParam('pubmatic', 'password')
     self.app_token = Config.getParam('pubmatic', 'app_token')
     self.grant_type = Config.getParam('pubmatic', 'grant_type')
     self.stream_logger = StreamLogger.getLogger(__name__)
Пример #9
0
 def __init__(self, account_id=None, credentials=None):
     self.stream_logger = StreamLogger.getLogger(__name__)
     self.account_id = account_id if account_id else 'tdg-network'
     self.client_id = Config.getParam('taboola', 'client_id')
     self.client_secret = Config.getParam('taboola', 'client_secret')
Пример #10
0
 def __init__(self):
     self.networkid = Config.getParam('smart', 'networkid')
     self.username = Config.getParam('smart', 'username')
     self.password = Config.getParam('smart', 'password')
Пример #11
0
 def __init__(self, startdate, enddate, sub_platform):
     self.token = self.token = Config.getParam(sub_platform, 'apitoken')
     self.sub_platform = sub_platform
     self.startdate = startdate
     self.enddate = enddate
     self.stream_logger = StreamLogger.getLogger(__name__)    
Пример #12
0
 def __init__(self, app):
     self.name = Config.getParam(app, 'name')
     self.id = Config.getParam(app, 'id')
     self.secret = Config.getParam(app, 'secret')
     self.stream_logger = StreamLogger.getLogger(__name__)