コード例 #1
0
for game in games:
    sk = game.get("__search_key__")
    code = game.get("code")
    name = game.get("name")
    print name

    expr = "@MAX(simpleslot/game['code','" + code + "'].sthpw/task.bid_end_date)"
    try:
        bed = server.eval(expr)
        bed = parser.parse(bed)
        
   
        if bed.month >= 1 and bed.month <= 3:
            quarter = 'Q1'
        elif bed.month >= 4 and bed.month <= 6:
            quarter = 'Q2'
        elif bed.month >= 7 and bed.month <= 9:
            quarter = 'Q3'
        elif bed.month >= 10 and bed.month <= 12:
            quarter = 'Q4'

        quarter_data = {'brief_quarter': quarter}
        year_data = {'brief_year': bed.year}

        server.update(sk, quarter_data)
        print year_data
    except:
        print "probably no tasks"
        

コード例 #2
0
import tacticenv
from tactic_client_lib import TacticServerStub

server = TacticServerStub(protocol="xmlrpc")
#server.set_project("sample3d")
server.set_ticket("60128265ebea63620de1f5b0ffc502eb")
search_type = "prod/shot"

server.start(title='cow')
sobject = server.insert(search_type, {'description': 'wow'})
server.update(search_key, {'description': 'another update'})
server.finish()

sobject = server.insert(search_type, {'description': 'wow2'})
sobject = server.insert(search_type, {'description': 'wow3'})
コード例 #3
0
    if game_type[0] == "casino" or game_type[0] == "video_conf":
        #if game_name == "cf_king_of_hidden_weapons":
        for casino_process in casino_processes:
            expr = "@MIN(simpleslot/game['name','" + game_name + "'].simpleslot/3d.sthpw/task['process','" + casino_process + "'].bid_start_date)"
            temp_min = server.eval(expr)

            expr = "@MAX(simpleslot/game['name','" + game_name + "'].simpleslot/3d.sthpw/task['process','" + casino_process + "'].bid_end_date)"
            temp_max = server.eval(expr)

            if temp_min != None or temp_max != None:
                data["threed_" + casino_process + "_min"] = temp_min
                data["threed_" + casino_process + "_max"] = temp_max
    insert = 1

    for game_in_combine in task_combine:  #match combine list names to master list, if match, only update.
        code = game_in_combine.get("game_code")
        sk = game_in_combine.get("__search_key__")
        if code == game_code:
            inlist.append(data)

            server.update(sk, data)
            insert = 0
            break

    if insert == 1:  #if game not in combine list, insert
        server.insert(task_combine_sk, data)
        inlist.append(data)

#return inlist
コード例 #4
0
    pipeline_code = task.get("pipeline_code")
    context = task.get("context")

    status = task.get("status")
    bsd = task.get("bid_start_date")
    bed = task.get("bid_end_date")
    assigned = task.get("assigned")
    data = {
        'search_code': search_code,
        'process': process,
        'status': status,
        'assigned': assigned,
        'bid_start_date': bsd,
        'bid_end_date': bed,
        'search_type': search_type,
        'pipeline_code': pipeline_code,
        'context': context
    }
    new_task = server.insert("sthpw/task", data)
    new_task_code = new_task.get("code")

    expr = "@SOBJECT(sthpw/snapshot['search_code','" + code + "'])"
    snapshots = server.eval(expr)

    for snapshot in snapshots:
        print snapshot.get("context")
        snapshot_sk = snapshot.get("__search_key__")

        snapshot_data = {'search_code': new_task_code}
        server.update(snapshot_sk, snapshot_data)
コード例 #5
0
ファイル: transaction_test.py プロジェクト: 0-T-0/TACTIC
import tacticenv
from tactic_client_lib import TacticServerStub

server = TacticServerStub(protocol="xmlrpc")
#server.set_project("sample3d")
server.set_ticket("60128265ebea63620de1f5b0ffc502eb")
search_type = "prod/shot"

server.start(title='cow')
sobject = server.insert(search_type, { 'description': 'wow'} )
server.update(search_key, { 'description': 'another update'} )
server.finish()

sobject = server.insert(search_type, { 'description': 'wow2'} )
sobject = server.insert(search_type, { 'description': 'wow3'} )