Exemplo n.º 1
0
def add_donor(dtype, dname):
    fn = D.get(dtype)
    L = rP(fn)
    if not L: L = []
    if dname not in L:
        L.append(dname)
    wP(L, fn)
Exemplo n.º 2
0
def add_donor (dtype, dname):
    fn = D.get(dtype)
    L = rP(fn)
    if not L: L = []
    if dname not in L:
        L.append(dname)
    wP(L, fn)
Exemplo n.º 3
0
def get_residencies ():
    progdict = {}
    allfiles = glob.glob(os.path.join(REZDIR, '*'))
    for file in allfiles:
        fdict = rP(file)
        progdict[fdict.get('institution')] = fdict
    return progdict
Exemplo n.º 4
0
def get_residencies():
    progdict = {}
    allfiles = glob.glob(os.path.join(REZDIR, '*'))
    for file in allfiles:
        fdict = rP(file)
        progdict[fdict.get('institution')] = fdict
    return progdict
Exemplo n.º 5
0
def get_members_order (comm_id):
    MB_ORD = os.path.join(DATADIR, comm_id, 'members.order')
    a = rP(MB_ORD)
    if a:
        return a
    else:
        return []
Exemplo n.º 6
0
def get_committee_order ():
    # ['0001', '0002', ...]
    a = rP(COMM_ORD)
    if a:
        return a
    else:
        return []
Exemplo n.º 7
0
def get_all_minutes ():
    FINAL = {}
    all_ids = glob.glob(os.path.join(MINS_DIR, '*'))
    for fpath in all_ids:
        file_id = os.path.basename(fpath)
        file_dict = rP(fpath)
        FINAL[file_id] = file_dict
    return FINAL
Exemplo n.º 8
0
def get_all_minutes():
    FINAL = {}
    all_ids = glob.glob(os.path.join(MINS_DIR, '*'))
    for fpath in all_ids:
        file_id = os.path.basename(fpath)
        file_dict = rP(fpath)
        FINAL[file_id] = file_dict
    return FINAL
Exemplo n.º 9
0
def get_resources ():
    allfiles = glob.glob(os.path.join(REZDIR, '*'))
    rezlist = []
    for file in allfiles:
        pick = rP(file)
        catguid = pick.get('category')
        pick['category'] = get_category_by_guid(catguid)
        if pick.get('filename'):
            filepath = os.path.join(FILEDIR, pick.get('filename'))
            pick['filesize'] = pretty_size(os.path.getsize(filepath))
        rezlist.append(pick)
    return rezlist
Exemplo n.º 10
0
def getCommittees():
    return rP(COMFILE)
Exemplo n.º 11
0
def toggle_travel():
    flag = rP(TRAVELFLAG)
    if flag == True:
        wP(False, TRAVELFLAG)
    else:
        wP(True, TRAVELFLAG)
Exemplo n.º 12
0
def show_travel():
    p = rP(TRAVELFLAG)
    return p
Exemplo n.º 13
0
def toggle_travel():
    flag = rP(TRAVELFLAG)
    if flag == True:
        wP(False, TRAVELFLAG)
    else:
        wP(True, TRAVELFLAG)
Exemplo n.º 14
0
def getCommittees():
    return rP(COMFILE)
Exemplo n.º 15
0
def get_one_residency(id):
    return rP(os.path.join(REZDIR, id))
Exemplo n.º 16
0
def get_rtc_categories ():
    return rP(RTC_CAT_FILE)
Exemplo n.º 17
0
def get_new_job_ID():
    newid = rP(JOBCOUNT)
    nextid = newid + 1
    wP(nextid, JOBCOUNT)
    return str(newid)
Exemplo n.º 18
0
def get_one_residency (id):
    return rP(os.path.join(REZDIR, id))
Exemplo n.º 19
0
def get_minutes(id):
    return rP(os.path.join(MINS_DIR, id))
Exemplo n.º 20
0
def getBOD():
    return rP(BODFILE)
Exemplo n.º 21
0
def get_rtc_name_map ():
    return rP(RTC_MAP_FILE)
Exemplo n.º 22
0
def get_resource_by_id (id):
    return rP(os.path.join(REZDIR, id))
Exemplo n.º 23
0
def get_job_info(JOB_ID):
    fullpath = os.path.join(JOBDIR, JOB_ID)
    if os.path.exists(fullpath):
        return rP(fullpath)
    else:
        return {}
Exemplo n.º 24
0
def get_donors (dtype='r'):
    L = rP(D.get(dtype))
    if not L: L = []
    L = sorted(L, key=lambda x: (x.isdigit() and float(x)) or x.lower())
    return L
Exemplo n.º 25
0
def get_committees ():
     # {'0001': {'name': str}, '0002': ... }
    return rP(COMM_MAP)
Exemplo n.º 26
0
def get_new_job_ID ():
    newid = rP(JOBCOUNT)
    nextid = newid +1
    wP(nextid, JOBCOUNT)
    return str(newid)
Exemplo n.º 27
0
def get_members (comm_id):
    MB_MAP = os.path.join(DATADIR, comm_id, 'members.map')
    return rP(MB_MAP)
Exemplo n.º 28
0
def get_job_info (JOB_ID):
    fullpath = os.path.join(JOBDIR, JOB_ID)
    if os.path.exists(fullpath):
        return rP(fullpath)
    else:
        return {}
Exemplo n.º 29
0
def get_donors(dtype='r'):
    L = rP(D.get(dtype))
    if not L: L = []
    L = sorted(L, key=lambda x: (x.isdigit() and float(x)) or x.lower())
    return L
Exemplo n.º 30
0
def del_donor (dtype, dname):
    fn = D.get(dtype)
    L = rP(fn)
    if dname in L:
        del L[L.index(dname)]
    wP(L, fn)
Exemplo n.º 31
0
def getBOD():
    return rP(BODFILE)
Exemplo n.º 32
0
def del_donor(dtype, dname):
    fn = D.get(dtype)
    L = rP(fn)
    if dname in L:
        del L[L.index(dname)]
    wP(L, fn)
Exemplo n.º 33
0
def get_minutes (id):
    return rP(os.path.join(MINS_DIR, id))
Exemplo n.º 34
0
def show_travel():
    p = rP(TRAVELFLAG)
    return p