Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, number: int, date: datetime, zone_id: int, data_rows: list, key: str):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, "group_provider_sercher_")
self.date = date
self.zone_id = zone_id
self.data_rows = data_rows
self.key = key
__author__ = 'Alexey Y Manikin'
from classes.statistic_worker.statisticBaseClass import StatisticBaseClass
import MySQLdb
import datetime
from config.main import MINIMUM_DOMAIN_COUNT, PREFIX_LIST_ZONE
class AsCountStatistic(StatisticBaseClass):
def __init__(self, number: int, data: datetime, today: datetime, zone: str):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, "as_count_")
self.today = today
self.data = data
self.zone_id = PREFIX_LIST_ZONE[zone]
def _get_data(self, date: datetime) -> list:
"""
В зависимости от дня статистики обращаемся или к domain_history или к domain
:return:
"""
__author__ = 'Alexey Y Manikin'
from classes.statistic_worker.statisticBaseClass import StatisticBaseClass
import MySQLdb
import datetime
from config.main import PREFIX_LIST_ZONE
class BegetAsToStatistic(StatisticBaseClass):
def __init__(self, number: int, data: datetime, today: datetime, zone: str):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, 'beget_as_to')
self.today = today
self.data = data
self.zone = PREFIX_LIST_ZONE[zone]
def _update(self):
"""
:return:
"""
date = self.data
today = self.today
__author__ = 'Alexey Y Manikin'
from classes.statistic_worker.statisticBaseClass import StatisticBaseClass
import MySQLdb
import datetime
from config.main import MINIMUM_DOMAIN_COUNT, PREFIX_LIST_ZONE
class RegistrantCountStatistic(StatisticBaseClass):
def __init__(self, number: int, data: datetime, today: datetime, zone: str):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, "registrant_count_")
self.today = today
self.data = data
self.zone_id = PREFIX_LIST_ZONE[zone]
def _get_data(self, date: datetime) -> list:
"""
В зависимости от дня статистики обращаемся или к domain_history или к domain
:return:
"""
cursor = self.connection.cursor(MySQLdb.cursors.DictCursor)
__author__ = 'Alexey Y Manikin'
from classes.statistic_worker.statisticBaseClass import StatisticBaseClass
import MySQLdb
import datetime
from config.main import MINIMUM_DOMAIN_COUNT, PREFIX_LIST_ZONE
class NsDomainOldCountStatistic(StatisticBaseClass):
def __init__(self, number: int, data: datetime, today: datetime, zone: str):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, "ns_domain_old_count_")
self.today = today
self.data = data
self.zone_id = PREFIX_LIST_ZONE[zone]
def _get_data(self, number: int, date: datetime) -> list:
"""
В зависимости от дня статистики обращаемся или к domain_history или к domain
:return:
"""
cursor = self.connection.cursor(MySQLdb.cursors.DictCursor)
__author__ = 'Alexey Y Manikin'
from classes.statistic_worker.statisticBaseClass import StatisticBaseClass
import MySQLdb
import datetime
class BegetRegistrantFromStatistic(StatisticBaseClass):
def __init__(self, number: int, data: datetime, today: datetime):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, 'beget_registrant_from')
self.today = today
self.data = data
def _update(self):
"""
:return:
"""
date = self.data
today = self.today
__author__ = 'Alexey Y Manikin'
from classes.statistic_worker.statisticBaseClass import StatisticBaseClass
import MySQLdb
import datetime
from config.main import PREFIX_LIST_ZONE
class BegetAsFromStatistic(StatisticBaseClass):
def __init__(self, number: int, data: datetime, today: datetime, zone: str):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, 'beget_as_from')
self.today = today
self.data = data
self.zone = PREFIX_LIST_ZONE[zone]
def _update(self):
"""
:type date: date
:type today: date
:type zone: unicode
:return:
def create_table(provider: str):
sql = """CREATE TABLE IF NOT EXISTS `%s_domain_as_from_count_statistic` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
`domain_name` varchar(256) DEFAULT NULL,
`as_from` int(11) NOT NULL,
`tld` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `date` (`date`),
KEY `domain_name` (`domain_name`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;""" % provider
StatisticBaseClass.create_db_if_not_exist(sql)
def __init__(self, number: int, data: datetime, today: datetime, zone: str):
"""
:param number:
"""
StatisticBaseClass.__init__(self, number, "a_count_")
self.today = today
self.data = data
self.zone_id = PREFIX_LIST_ZONE[zone]