def __init__(self, cookies=None): self.session = requests.Session() self._has_next = None self.logger = logger.create_rotating_log() if cookies is not None: self.session.cookies.update(cookies)
def __init__(self, keys=[], sources=[], n_thread=2, from_date=None, to_date=None): self.keys = keys self.sources = sources self.n_thread = n_thread self.threads = [] self.container = [] self.logger = logger.create_rotating_log() self.set_date(from_date, to_date) self.whole_file = None self.cookies_handler = CookiesHandler()
def config_logging(config): log_config = config.get("logging") LOGGER = create_rotating_log(log_config.get("path"), log_config.get("level")) LOGGER.debug("Logging configured successfully")
import sys import cv2 import numpy as np import yaml from camera import Camera from logger import create_rotating_log from database import full_engine LOGGER = create_rotating_log('/var/log/count.log', 'info') def validate_tenant(tenant, key): #TODO: This method will validate to an admin API if the tenant is valid return True def config_logging(config): log_config = config.get("logging") LOGGER = create_rotating_log(log_config.get("path"), log_config.get("level")) LOGGER.debug("Logging configured successfully") def get_cameras_from_tenant(id_tenant): query = "SELECT id, source, detection_area, max_person_age, source_user, source_password, description FROM cameras WHERE " \ "id_tenant = {id_tenant}".format(id_tenant=str(id_tenant)) connection = full_engine.connect() result = connection.execute(query) cameras = [] for row in result:
def __init__(self): self.path = 'cookies' self.logger = logger.create_rotating_log()