コード例 #1
0
ファイル: filemonitor.py プロジェクト: nv043/rainwave
def monitor():
    _common_init()

    pid = os.getpid()
    pid_file = open("%s/scanner.pid" % config.get_directory("pid_dir"), 'w')
    pid_file.write(str(pid))
    pid_file.close()

    observers = []
    for directory, sids in config.get("song_dirs").iteritems():
        observer = RWObserver()
        observer.schedule(FileEventHandler(directory, sids),
                          directory,
                          recursive=True)
        observer.start()
        log.info("scan", "Observing %s with sids %s" % (directory, repr(sids)))
        observers.append(observer)

    try:
        while True:
            time.sleep(1)
    finally:
        for observer in observers:
            observer.stop()
        for observer in observers:
            observer.join()
コード例 #2
0
ファイル: filemonitor.py プロジェクト: Dinir/rainwave
def monitor():
    _common_init()

    pid = os.getpid()
    pid_file = open("%s/scanner.pid" % config.get_directory("pid_dir"), 'w')
    pid_file.write(str(pid))
    pid_file.close()

    observers = []
    for directory, sids in config.get("song_dirs").iteritems():
        observer = watchdog.observers.Observer()
        observer.schedule(FileEventHandler(directory, sids),
                          directory,
                          recursive=True)
        observer.start()
        log.info("scan", "Observing %s with sids %s" % (directory, repr(sids)))
        observers.append(observer)

    try:
        while True:
            time.sleep(60)
            _process_album_art_queue()
    except Exception as e:
        log.exception("scan", "Exception leaked to top monitoring function.",
                      e)
        for observer in observers:
            observer.stop()
    for observer in observers:
        observer.join()
コード例 #3
0
ファイル: filemonitor.py プロジェクト: MagnusVortex/rainwave
def monitor():
	_common_init()

	pid = os.getpid()
	pid_file = open("%s/scanner.pid" % config.get_directory("pid_dir"), 'w')
	pid_file.write(str(pid))
	pid_file.close()

	observers = []
	for directory, sids in config.get("song_dirs").iteritems():
		observer = watchdog.observers.Observer()
		observer.schedule(FileEventHandler(directory, sids), directory, recursive=True)
		observer.start()
		log.info("scan", "Observing %s with sids %s" % (directory, repr(sids)))
		observers.append(observer)

	try:
		while True:
			time.sleep(60)
			_process_album_art_queue()
	except Exception as e:
		log.exception("scan", "Exception leaked to top monitoring function.", e)
		for observer in observers:
			observer.stop()
	for observer in observers:
		observer.join()
コード例 #4
0
ファイル: filemonitor.py プロジェクト: khakionion/rainwave
def monitor():
    _common_init()

    pid = os.getpid()
    pid_file = open("%s/scanner.pid" % config.get_directory("pid_dir"), 'w')
    pid_file.write(str(pid))
    pid_file.close()

    observers = []
    for directory, sids in config.get("song_dirs").iteritems():
        observer = watchdog.observers.Observer()
        observer.schedule(FileEventHandler(directory, sids),
                          directory,
                          recursive=True)
        observer.start()
        observers.append(observer)

    try:
        while True:
            time.sleep(60)
            _process_album_art_queue()
    except:
        for observer in observers:
            observer.stop()
    for observer in observers:
        observer.join()
コード例 #5
0
ファイル: filemonitor.py プロジェクト: DarkLink1108/rainwave
def monitor():
	_common_init()

	pid = os.getpid()
	pid_file = open("%s/scanner.pid" % config.get_directory("pid_dir"), 'w')
	pid_file.write(str(pid))
	pid_file.close()

	observers = []
	for directory, sids in config.get("song_dirs").iteritems():
		observer = watchdog.observers.Observer()
		observer.schedule(FileEventHandler(directory, sids), directory, recursive=True)
		observer.start()
		observers.append(observer)

	try:
		while True:
			time.sleep(60)
			_process_album_art_queue()
	except:
		for observer in observers:
			observer.stop()
	for observer in observers:
		observer.join()
コード例 #6
0
ファイル: filemonitor.py プロジェクト: TheFungineer/rainwave
def monitor():
	_common_init()

	pid = os.getpid()
	pid_file = open("%s/scanner.pid" % config.get_directory("pid_dir"), 'w')
	pid_file.write(str(pid))
	pid_file.close()

	observers = []
	for directory, sids in config.get("song_dirs").iteritems():
		observer = RWObserver()
		observer.schedule(FileEventHandler(directory, sids), directory, recursive=True)
		observer.start()
		log.info("scan", "Observing %s with sids %s" % (directory, repr(sids)))
		observers.append(observer)

	try:
		while True:
			time.sleep(1)
	finally:
		for observer in observers:
			observer.stop()
		for observer in observers:
			observer.join()