class Controller(object):
    """
    Controller controls sequence from downloadnig to parsing.
    As default for widget logger.
    """
    def __init__(self, ):
        """
        init
        """

        logger = logging.getLogger("Controller")
        logger.setLevel(logging.INFO)
        logging.basicConfig()
        self.logger = logger

        self.mixs_log_importer = MixsLogImporter()
        self.power_sampler_log_importer = PowerSamplerLogImporter()
        self.user_all_logs_converter = UserAllLogsConverter()
        self.user_all_logs_summary_converter = UserAllLogsSummaryConverter()
        self.all_users_all_logs_summary_converter = AllUsersAllLogsSummaryConverter(
        )
        self.app_all_logs_converter = AppAllLogsConverter()
        self.app_all_logs_summary_converter = AppAllLogsSummaryConverter()
        self.all_apps_all_logs_summary_converter = AllAppsAllLogsSummaryConverter(
        )
        self.transporter = MixsLogTransporter()

        pass

    def control(self, ):
        """
        control
        """

        self.logger.info("controll starts")
        st = time.time()

        #self.power_sampler_log_importer.imports()

        self.mixs_log_importer.imports()
        self.user_all_logs_converter.convert()
        self.user_all_logs_summary_converter.convert()
        self.all_users_all_logs_summary_converter.convert()

        self.app_all_logs_converter.convert()
        self.app_all_logs_summary_converter.convert()
        self.all_apps_all_logs_summary_converter.convert()

        self.transporter.transport()

        et = time.time()
        self.logger.info("total time: %f[s]" % (et - st))
        self.logger.info("controll finished")
        pass

    pass
class Controller(object):
    """
    Controller controls sequence from downloadnig to parsing.
    As default for widget logger.
    """
    
    def __init__(self, ):
        """
        init
        """

        logger = logging.getLogger("Controller")
        logger.setLevel(logging.INFO)
        logging.basicConfig()
        self.logger = logger
        
        self.mixs_log_importer = MixsLogImporter()
        self.power_sampler_log_importer = PowerSamplerLogImporter()
        self.user_all_logs_converter = UserAllLogsConverter()
        self.user_all_logs_summary_converter = UserAllLogsSummaryConverter()
        self.all_users_all_logs_summary_converter = AllUsersAllLogsSummaryConverter()
        self.app_all_logs_converter = AppAllLogsConverter()
        self.app_all_logs_summary_converter = AppAllLogsSummaryConverter()
        self.all_apps_all_logs_summary_converter = AllAppsAllLogsSummaryConverter()
        self.transporter = MixsLogTransporter()

        pass
    
    def control(self, ):
        """
        control
        """

        self.logger.info("controll starts")
        st = time.time()

        #self.power_sampler_log_importer.imports()

        self.mixs_log_importer.imports()
        self.user_all_logs_converter.convert()
        self.user_all_logs_summary_converter.convert()
        self.all_users_all_logs_summary_converter.convert()
        
        self.app_all_logs_converter.convert()
        self.app_all_logs_summary_converter.convert()
        self.all_apps_all_logs_summary_converter.convert()

        self.transporter.transport()

        et = time.time()
        self.logger.info("total time: %f[s]" % (et-st))
        self.logger.info("controll finished")
        pass

    pass
    def __init__(self, ):
        """
        init
        """

        logger = logging.getLogger("Controller")
        logger.setLevel(logging.INFO)
        logging.basicConfig()
        self.logger = logger

        self.mixs_log_importer = MixsLogImporter()
        self.power_sampler_log_importer = PowerSamplerLogImporter()
        self.user_all_logs_converter = UserAllLogsConverter()
        self.user_all_logs_summary_converter = UserAllLogsSummaryConverter()
        self.all_users_all_logs_summary_converter = AllUsersAllLogsSummaryConverter(
        )
        self.app_all_logs_converter = AppAllLogsConverter()
        self.app_all_logs_summary_converter = AppAllLogsSummaryConverter()
        self.all_apps_all_logs_summary_converter = AllAppsAllLogsSummaryConverter(
        )
        self.transporter = MixsLogTransporter()

        pass
    def __init__(self, ):
        """
        init
        """

        logger = logging.getLogger("Controller")
        logger.setLevel(logging.INFO)
        logging.basicConfig()
        self.logger = logger
        
        self.mixs_log_importer = MixsLogImporter()
        self.power_sampler_log_importer = PowerSamplerLogImporter()
        self.user_all_logs_converter = UserAllLogsConverter()
        self.user_all_logs_summary_converter = UserAllLogsSummaryConverter()
        self.all_users_all_logs_summary_converter = AllUsersAllLogsSummaryConverter()
        self.app_all_logs_converter = AppAllLogsConverter()
        self.app_all_logs_summary_converter = AppAllLogsSummaryConverter()
        self.all_apps_all_logs_summary_converter = AllAppsAllLogsSummaryConverter()
        self.transporter = MixsLogTransporter()

        pass