Example #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)
Example #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)
Example #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
Example #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
Example #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 []
Example #6
0
def get_committee_order ():
    # ['0001', '0002', ...]
    a = rP(COMM_ORD)
    if a:
        return a
    else:
        return []
Example #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
Example #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
Example #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
Example #10
0
def getCommittees():
    return rP(COMFILE)
Example #11
0
def toggle_travel():
    flag = rP(TRAVELFLAG)
    if flag == True:
        wP(False, TRAVELFLAG)
    else:
        wP(True, TRAVELFLAG)
Example #12
0
def show_travel():
    p = rP(TRAVELFLAG)
    return p
Example #13
0
def toggle_travel():
    flag = rP(TRAVELFLAG)
    if flag == True:
        wP(False, TRAVELFLAG)
    else:
        wP(True, TRAVELFLAG)
Example #14
0
def getCommittees():
    return rP(COMFILE)
Example #15
0
def get_one_residency(id):
    return rP(os.path.join(REZDIR, id))
Example #16
0
def get_rtc_categories ():
    return rP(RTC_CAT_FILE)
Example #17
0
def get_new_job_ID():
    newid = rP(JOBCOUNT)
    nextid = newid + 1
    wP(nextid, JOBCOUNT)
    return str(newid)
Example #18
0
def get_one_residency (id):
    return rP(os.path.join(REZDIR, id))
Example #19
0
def get_minutes(id):
    return rP(os.path.join(MINS_DIR, id))
Example #20
0
def getBOD():
    return rP(BODFILE)
Example #21
0
def get_rtc_name_map ():
    return rP(RTC_MAP_FILE)
Example #22
0
def get_resource_by_id (id):
    return rP(os.path.join(REZDIR, id))
Example #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 {}
Example #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
Example #25
0
def get_committees ():
     # {'0001': {'name': str}, '0002': ... }
    return rP(COMM_MAP)
Example #26
0
def get_new_job_ID ():
    newid = rP(JOBCOUNT)
    nextid = newid +1
    wP(nextid, JOBCOUNT)
    return str(newid)
Example #27
0
def get_members (comm_id):
    MB_MAP = os.path.join(DATADIR, comm_id, 'members.map')
    return rP(MB_MAP)
Example #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 {}
Example #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
Example #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)
Example #31
0
def getBOD():
    return rP(BODFILE)
Example #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)
Example #33
0
def get_minutes (id):
    return rP(os.path.join(MINS_DIR, id))
Example #34
0
def show_travel():
    p = rP(TRAVELFLAG)
    return p