Ejemplo n.º 1
0
def _categorize_for_a_day(prd, categorizer, **kwargs):
    """
    :type prd: pyticas.ttypes.Period
    :type categorizer: any
    """
    da_route = route.TTRouteDataAccess()
    route_list = da_route.list()
    for a_route in route_list:
        categorization.categorize(a_route, prd, categorizers=[categorizer], **kwargs)
    da_route.close_session()
def run():
    """
    :return:
    :rtype:
    """
    ttr_da = route.TTRouteDataAccess()
    ttris = ttr_da.list()
    ttr_da.close_session()

    for ttri in ttris:
        _checkup_tt_for_a_route(ttri)
Ejemplo n.º 3
0
def run(sdate, edate):
    """
    :type sdate: datetime.date
    :type edate: datetime.date
    :return:
    :rtype:
    """
    ttr_da = route.TTRouteDataAccess()
    ttris = ttr_da.list()
    ttr_da.close_session()

    periods = period.create_periods(sdate, edate, datetime.time(0, 0, 0, 0), datetime.time(23, 59, 0, 0),
                                    cfg.TT_DATA_INTERVAL,
                                    remove_holiday=False,
                                    target_days=[0,1,2,3,4,5,6],
                                    )

    logger = getLogger(__name__)
    logger.debug('>>> checking tt-weather data')
    for prd in periods:
        for ttri in ttris:
            _checkup_tt_weather_for_a_route(ttri, prd)

    logger.debug('<<< end of checking tt-weather data')