def get_position_repositories(uid, args, position, flag_total, only_uris): positions_id = store.get_all_members_id(position) if uid not in positions_id: return [] else: projects = store.get_all_member_projects(positions_id[uid]) res_prj = set() res = [] for x in projects: repos = store.get_all_project_repositories(x) if not flag_total: for k in repos: rep_info = store.db.hgetall(k) if detect_overlap_date( args.get('begin'), args.get('end'), rep_info.get('first_commit'), rep_info.get('last_commit') ): res_prj.add(k) if only_uris: return res_prj else: [res.append({ 'id': store.db.hgetall(x).get('id'), 'uri': x }) for x in res_prj] return res
def get_position_projects(uid, args, position, flag_total, only_uris): positions_id = store.get_all_members_id(position) if uid not in positions_id: return [] else: projects = store.get_all_member_projects(positions_id[uid]) if not flag_total: res_prj = set() for x in projects: if detect_project_repositories_overlap(x, args): res_prj.add(x) projects = list(res_prj) res = [] if only_uris: return projects else: [res.append({ 'id': store.db.get(x), 'uri': x }) for x in projects] return res