Example #1
0
def tracker_lastfmMain():
    if not appinfo.config.lastFm: return

    assert "append" in OnRequestQueue.ListUsedModFunctions
    assert PlayerEventCallbacks.onSongChange is not None
    assert PlayerEventCallbacks.onSongFinished is not None

    queueList = PersistentObject(
        deque,
        "lastfm-queue.dat",
        namespace=globals(),
        customAttribs={"append": stateUpdates_append_wrapper},
        installAutosaveWrappersOn=OnRequestQueue.ListUsedModFunctions,
    )

    stateUpdateStream = state.updates.read(queueList=queueList)

    lastfm.login()
    for ev, args, kwargs in stateUpdateStream:
        try:
            track(ev, args, kwargs)
        except Exception:
            sys.excepthook(*sys.exc_info())
        else:
            queueList.save()
    lastfm.quit()
Example #2
0
def trackerMain():
	lastfm.login()	
	for ev,args,kwargs in state.updates.read():
		try:
			track(ev, args, kwargs)
		except:
			sys.excepthook(*sys.exc_info())
	lastfm.quit()
Example #3
0
def tracker_lastfmMain():
    if not appinfo.config.lastFm: return

    lastfm.login()
    for ev, args, kwargs in state.updates.read(
            listType=lambda: PersistentObject(
                deque, "lastfm-queue.dat", namespace=globals())):
        try:
            track(ev, args, kwargs)
        except:
            sys.excepthook(*sys.exc_info())
    lastfm.quit()
Example #4
0
def tracker_lastfmMain():
	if not appinfo.config.lastFm: return

	lastfm.login()
	for ev,args,kwargs in state.updates.read(
		listType = lambda: PersistentObject(deque, "lastfm-queue.dat", namespace=globals())
	):
		try:
			track(ev, args, kwargs)
		except:
			sys.excepthook(*sys.exc_info())
	lastfm.quit()
Example #5
0
def tracker_lastfmMain():
	if not appinfo.config.lastFm: return

	assert "append" in OnRequestQueue.ListUsedModFunctions
	assert PlayerEventCallbacks.onSongChange is not None
	assert PlayerEventCallbacks.onSongFinished is not None
	
	queueList = PersistentObject(
		deque, "lastfm-queue.dat", namespace=globals(),
		customAttribs = {"append": stateUpdates_append_wrapper},
		installAutosaveWrappersOn = OnRequestQueue.ListUsedModFunctions,
		)
	
	stateUpdateStream = state.updates.read(queueList=queueList)

	lastfm.login()
	for ev,args,kwargs in stateUpdateStream:
		try:
			track(ev, args, kwargs)
		except Exception:
			sys.excepthook(*sys.exc_info())
		else:
			queueList.save()			
	lastfm.quit()