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)
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)
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
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
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 []
def get_committee_order (): # ['0001', '0002', ...] a = rP(COMM_ORD) if a: return a else: return []
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
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
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
def getCommittees(): return rP(COMFILE)
def toggle_travel(): flag = rP(TRAVELFLAG) if flag == True: wP(False, TRAVELFLAG) else: wP(True, TRAVELFLAG)
def show_travel(): p = rP(TRAVELFLAG) return p
def get_one_residency(id): return rP(os.path.join(REZDIR, id))
def get_rtc_categories (): return rP(RTC_CAT_FILE)
def get_new_job_ID(): newid = rP(JOBCOUNT) nextid = newid + 1 wP(nextid, JOBCOUNT) return str(newid)
def get_one_residency (id): return rP(os.path.join(REZDIR, id))
def get_minutes(id): return rP(os.path.join(MINS_DIR, id))
def getBOD(): return rP(BODFILE)
def get_rtc_name_map (): return rP(RTC_MAP_FILE)
def get_resource_by_id (id): return rP(os.path.join(REZDIR, id))
def get_job_info(JOB_ID): fullpath = os.path.join(JOBDIR, JOB_ID) if os.path.exists(fullpath): return rP(fullpath) else: return {}
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
def get_committees (): # {'0001': {'name': str}, '0002': ... } return rP(COMM_MAP)
def get_new_job_ID (): newid = rP(JOBCOUNT) nextid = newid +1 wP(nextid, JOBCOUNT) return str(newid)
def get_members (comm_id): MB_MAP = os.path.join(DATADIR, comm_id, 'members.map') return rP(MB_MAP)
def get_job_info (JOB_ID): fullpath = os.path.join(JOBDIR, JOB_ID) if os.path.exists(fullpath): return rP(fullpath) else: return {}
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
def del_donor (dtype, dname): fn = D.get(dtype) L = rP(fn) if dname in L: del L[L.index(dname)] wP(L, fn)
def del_donor(dtype, dname): fn = D.get(dtype) L = rP(fn) if dname in L: del L[L.index(dname)] wP(L, fn)
def get_minutes (id): return rP(os.path.join(MINS_DIR, id))