示例#1
0
文件: pms.py 项目: akoon/OldPipeline
def task(task_id):
    if not isLogin():
        return None

    url = r'http://%s/InterfaceSys/taskRead/' % penv.host()
    parm = {}
    parm['t_id'] = task_id
    
    return post(url, parm, penv.cookie())
示例#2
0
文件: pms.py 项目: akoon/OldPipeline
def publishAsset(asset_id, qc, files = None, to_dir = None):
    if not isLogin():
        return None

    url = r'http://%s/InterfaceSys/publishTask/' % penv.host()
    parm = {}
    parm['task_id'] = asset_id
    parm['qc'] = qc
    if files and to_dir:
        parm['is_copy'] = False
        parm['src'] = files
        parm['dst'] = to_dir.encode('UTF-8')
    else:
        parm['is_copy'] = True
    
    return post(url, parm, penv.cookie())
示例#3
0
文件: pms.py 项目: akoon/OldPipeline
def asset(task_id = None, asset_id = None):
    if not isLogin():
        return None

    url = r'http://%s/InterfaceSys/assetRead/' % penv.host()
    parm = {}
    if task_id:
        parm['t_id'] = task_id
    if asset_id:
        parm['a_id'] = asset_id
    
    a_json_stream = post(url, parm, penv.cookie())
    if not a_json_stream:
        return None

    a_data = json.loads(a_json_stream)
    a = passet.dict_to_asset(a_data)
    return a
示例#4
0
文件: pms.py 项目: akoon/OldPipeline
def getChild(asset_id):
    if not isLogin():
        return []

    url = r'http://%s/InterfaceSys/allRead/%s' % (penv.host(), asset_id)
    parm = {}
    parm['id'] = asset_id

    json_stream = post(url, parm, penv.cookie())
    if not json_stream:
        return []

    anythings = []
    a_data = json.loads(json_stream)
    for a_dict in a_data:
        a = passet.dict_to_asset(a_dict)
        if a:
            anythings.append(a)
    return anythings
示例#5
0
文件: pms.py 项目: akoon/OldPipeline
def projects():
    if not isLogin():
        return []

    url = r'http://%s/InterfaceSys/allRead/' % penv.host()
    parm = {}
    parm['id'] = 'p_id'
    proj_json_stream = post(url, parm, penv.cookie())

    if not proj_json_stream:
        return []

    projs = []
    projects_data = json.loads(proj_json_stream)
    for proj_dict in projects_data:
        proj = passet.Project(proj_dict['name'])
        proj.setAttributes(proj_dict)
        projs.append(proj)

    return projs
示例#6
0
文件: pms.py 项目: akoon/OldPipeline
def myTasks(project_id = None):
    if not isLogin():
        return []

    url = r'http://%s/InterfaceSys/taskRead/' % penv.host()
    parm = {}
    parm['username'] = penv.user()
    if project_id:
        parm['p_id'] = project_id
    
    ts_json_stream = post(url, parm, penv.cookie())
    if not ts_json_stream:
        return []

    ts = []
    ts_data = json.loads(ts_json_stream)
    for t_dict in ts_data:
        t = passet.dict_to_asset(t_dict)
        if t:
            ts.append(t)
    return ts
示例#7
0
文件: pms.py 项目: akoon/OldPipeline
def isLogin():
    if penv.cookie() and penv.host():
        return True
    else:
        return False