예제 #1
0
def append(q):
    collection().append(q)
    plex.user_dict().Save()
예제 #2
0
def remove(q):
    collection().remove(q)
    plex.user_dict().Save()
예제 #3
0
def initialize_dict(key, default = None):
    if not key in plex.user_dict():
        plex.user_dict()[key] = default

    return plex.user_dict()[key]
예제 #4
0
import plex
import user

def clear():      user.attempt_clear('searches')
def includes(q):  return q in collection()
def collection(): return user.initialize_dict('searches', [])

def toggle(q):
    try:
        if includes(q):
            remove(q)
            response = 'removed'
        else:
            append(q)
            response = 'added'
    except Exception, e:
        return 'error'

    plex.user_dict().Save()
    return response

def append(q):
    collection().append(q)
    plex.user_dict().Save()

def remove(q):
    collection().remove(q)
    plex.user_dict().Save()

예제 #5
0
def set_current(download):
    plex.user_dict()['download_current'] = download
    plex.user_dict().Save()
예제 #6
0
def attempt_clear(key):
    if key in plex.user_dict():
        del plex.user_dict()[key]
        plex.user_dict().Save()
예제 #7
0
def append(**kwargs):
    queue().append(kwargs)
    plex.user_dict().Save()
예제 #8
0
def remove(download):
    queue().remove(download)
    plex.user_dict().Save()
예제 #9
0
def assumed_running(): return 'download_current' in plex.user_dict()
def curl_running():    return pid_running(current_pid())
예제 #10
0
def current():         return plex.user_dict()['download_current']
def current_pid():     return current().get('pid')
예제 #11
0
 def store_curl_pid(dl):
     current()['title'] = dl.file_name()
     current()['pid']   = dl.pid
     plex.user_dict().Save()
예제 #12
0
def remove(endpoint):
    del collection()[endpoint]
    plex.user_dict().Save()
예제 #13
0
def append(**k):
    endpoint = k["endpoint"]
    del k["endpoint"]
    collection()[endpoint] = k
    plex.user_dict().Save()