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