コード例 #1
0
ファイル: empira.py プロジェクト: ayamatta/pir
def _move_task_beth_views(svid, dvid, tid):
    dest=core.getdoc('task-views', dvid)
    sour=core.getdoc('task-views', svid)
    _add_task_to_view(dvid, tid)
    for i in sour['path']:
        if not i in dest['path']:
            _del_task_from_view(i, tid)
    _del_task_from_view(svid, tid)
コード例 #2
0
ファイル: empira.py プロジェクト: ayamatta/pir
def _change_view_path(pvid, cvid, called_recursive=False):
    new_parent=core.getdoc('task-views', pvid)
    child=core.getdoc('task-views', cvid)
    old_path=child['path'][:]
    new_parent['subviews'].append(cvid)
    child['path']=new_parent['path']+[new_parent['_id']]
    core.setdoc('task-views', new_parent)
    core.setdoc('task-views', child)
    if not called_recursive:
        toclean=[]
        for i in old_path:
            if not i in new_parent['path']:
                toclean.append(i)
        for i in child['tasks']:
            _del_task_from_views(toclean, i)
    for i in child['subviews']:
        _change_view_path(cvid, i, called_recursive=True)
コード例 #3
0
ファイル: empira.py プロジェクト: ayamatta/pir
def _get_view_tidlist(vid, recursive=True):
    view=core.getdoc('task-views', vid)
    tidl=view['tasks']
    if recursive:
        for subview in view['subviews']:
            for tid in _get_view_tidlist(subview):
                if not tid in tidl:
                    tidl.append(tid)
    return tidl
コード例 #4
0
ファイル: empira.py プロジェクト: ayamatta/pir
def finish(un, tid):#optimize it
    t=_get_task(tid)
    t['finished']=time()
    t['finisher']=un
    path=core.getview('task-views', 'tasks/getfullpath', tid, reduce=True)
    t['finish_view']=path[-1]
    _set_task(t)
    view=core.getdoc('task-views', path[-1])
    if view['_id'].split('_')[1]=="proj":
        _add_task_to_view(view['_id'], tid, dest="finished_tasks")
    _move_task_beth_cat(path[-1], un+"_arch", tid)
    return True
コード例 #5
0
ファイル: groups.py プロジェクト: ayamatta/pir
def _create_group(bossid, name):
    glob=core.getdoc('groups', "glob")
    glob['counter']=glob['counter']+1
    temp=__create_group_dict(bossid, name, glob['counter'])
    core.setdoc('groups', glob)
    return core.setdoc('groups', temp)
コード例 #6
0
ファイル: groups.py プロジェクト: ayamatta/pir
def _add_member(uid, gid):
    group=core.getdoc('groups', str(gid))
    group['members'].append(uid)
    core.setdoc('groups', group)
コード例 #7
0
ファイル: empira.py プロジェクト: ayamatta/pir
def _del_task_from_view(vid, tid):
    view=core.getdoc('task-views', vid)
    if tid in view['tasks']:
        view['tasks'].remove(tid)
        core.setdoc('task-views', view)
コード例 #8
0
ファイル: empira.py プロジェクト: ayamatta/pir
def _add_task_to_view(vid, tid, dest="tasks"):
    view=core.getdoc('task-views', vid)
    view[dest].append(tid)
    core.setdoc('task-views', view)
コード例 #9
0
ファイル: empira.py プロジェクト: ayamatta/pir
def _get_task(tid):
    return core.getdoc('tasks', tid)
コード例 #10
0
ファイル: empira.py プロジェクト: ayamatta/pir
def _upd_task_order(vid, neworder):
    newview=core.getdoc('task-views', vid)
    newview['tasks']=neworder
    core.setdoc('task-views', newview)