Пример #1
0
def task_0():
    result = sg.find_one( "Asset", [['code','is_not','aabbcc']])
    if( cmp( result['id'], "" ) != 0 ):
        print "Ready to go."
        return 0
    else:
        print "Something Wrong."
        return 1
Пример #2
0
def task_10( ass_name, quiet = "0" ):
    find_res = sg.find_one( 'Asset', [[ 'code', 'is', ass_name ]], ['id', 'code'] )
    tmp_str = str( find_res ).lower()
    res = tmp_str.find( "none" )

    if( res != 0 ):
        print ( "Found match asset \"" + find_res['code'] + "\" #" + str( find_res['id'] ) + "." )
        res = 0
    else:
        if( int(quiet) != 1 ):
            print ( "Fail to find Asset named \"" + ass_name + "\"." )
        res = -1

    return res
Пример #3
0
def task_41( task_id, quiet = "0" ):
    find_res = sg.find_one( 'Task', [[ 'id', 'is', int( task_id ) ]], ['id', 'content'] )
    tmp_str = str( find_res ).lower()
    res = tmp_str.find( "none" )
    #print find_res

    if( res != 0 ):
        print ( "Found match Task \"" + find_res['content'] + "\" #" + str( find_res['id'] ) + "." )
        res = 0
    else:
        if( int(quiet) != 1 ):
            print ( "Fail to find Task id #" + task_id + "." )
        res = -1

    return res