def my_init(self,
                queue,
                airtime_config=None,
                wm=None,
                mmc=None,
                api_client=api_client):
        """
        Method automatically called from ProcessEvent.__init__(). Additional
        keyworded arguments passed to ProcessEvent.__init__() are then
        delegated to my_init().
        """
        self.logger = logging.getLogger()
        self.config = airtime_config

        #put the file path into this dict if we want to ignore certain
        #events. For example, when deleting a file from the web ui, we
        #are going to delete it from the db on the server side, so media-monitor
        #doesn't need to contact the server and tell it to delete again.
        self.ignore_event = set()

        self.temp_files = {}
        self.cookies_IN_MOVED_FROM = {}
        self.file_events = []
        self.multi_queue = queue
        self.wm = wm
        self.md_manager = AirtimeMetadata()
        self.mmc = mmc
        self.api_client = api_client
        self.create_dict = {}
        self.mount_file_dir = "/etc"
        self.mount_file = "/etc/mtab"
        self.curr_mtab_file = "/var/tmp/airtime/media-monitor/currMtab"
        self.prev_mtab_file = "/var/tmp/airtime/media-monitor/prevMtab"
Beispiel #2
0
    def __init__(self,
                 watch_manager,
                 default_proc_fun=None,
                 read_freq=0,
                 threshold=0,
                 timeout=None,
                 airtime_config=None,
                 api_client=None,
                 bootstrap=None,
                 mmc=None):
        Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
                          threshold, timeout)

        self.logger = logging.getLogger()
        self.config = airtime_config
        self.api_client = api_client
        self.bootstrap = bootstrap
        self.md_manager = AirtimeMetadata()
        self.import_processes = {}
        self.watched_folders = []
        self.mmc = mmc
        self.wm = watch_manager
        self.mask = pyinotify.ALL_EVENTS

        while not self.init_rabbit_mq():
            self.logger.error(
                "Error connecting to RabbitMQ Server. Trying again in few seconds"
            )
            time.sleep(5)
Beispiel #3
0
 def __init__(self, airtime_config):
     self.supported_file_formats = ['mp3', 'ogg']
     self.logger = logging.getLogger()
     self.config = airtime_config
     self.md_manager = AirtimeMetadata()
 def __init__(self, airtime_config, wm=None):
     self.logger = logging.getLogger()
     self.config = airtime_config
     self.md_manager = AirtimeMetadata()
     self.wm = wm