本文整理汇总了Python中client.tactic_client_lib.TacticServerStub类的典型用法代码示例。如果您正苦于以下问题:Python TacticServerStub类的具体用法?Python TacticServerStub怎么用?Python TacticServerStub使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TacticServerStub类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
def main():
config = ConfigParser.ConfigParser()
config.read('config.ini')
# Get credentials from config file
user = config.get('credentials', 'user')
password = config.get('credentials', 'password')
project = config.get('credentials', 'project')
# Just get the dev server URL for now
url = config.get('server', 'dev')
# Get a server object to perform queries
server = TacticServerStub(server=url, project=project, user=user, password=password)
# Set up a list of frame rates to insert
machines = ('VTR221', 'VTR222', 'VTR223', 'VTR224', 'VTR225', 'VTR231', 'VTR232', 'VTR233', 'VTR234', 'VTR235',
'VTR251', 'VTR252', 'VTR253', 'VTR254', 'VTR255', 'VTR261', 'VTR262', 'VTR263', 'VTR264', 'VTR265',
'VTR281', 'VTR282', 'VTR283', 'VTR284', 'VTR285', 'FCP01', 'FCP02', 'FCP03', 'FCP04', 'FCP05',
'FCP06', 'FCP07', 'FCP08', 'FCP09', 'FCP10', 'FCP11', 'FCP12', 'Amberfin', 'Clipster', 'Stradis')
# Get a list of already existing frame rates
existing_machines = server.eval('@SOBJECT(twog/machine)')
existing_machines = [existing_machine.get('name') for existing_machine in existing_machines]
# Filter out the frame rates that are already in the database
machines_to_insert = [machine for machine in machines if machine not in existing_machines]
for machine in machines_to_insert:
# Insert the frame rate
server.insert('twog/machine', {'name': machine})
示例2: main
def main():
config = ConfigParser.ConfigParser()
config.read('config.ini')
# Get credentials from config file
user = config.get('credentials', 'user')
password = config.get('credentials', 'password')
project = config.get('credentials', 'project')
# Just get the dev server URL for now
url = config.get('server', 'dev')
# Get a server object to perform queries
server = TacticServerStub(server=url, project=project, user=user, password=password)
# Set up a list of frame rates to insert
frame_rates = ['23.98fps', '59.94i', '50i', '29.97fps', '24p', '25p', '59.94p', 'DFTC', 'NDFTC', 'PAL/EBU']
# Get a list of already existing frame rates
existing_frame_rates = server.eval('@SOBJECT(twog/frame_rate)')
existing_frame_rates = [existing_frame_rate.get('name') for existing_frame_rate in existing_frame_rates]
# Filter out the frame rates that are already in the database
frame_rates_to_insert = [frame_rate for frame_rate in frame_rates if frame_rate not in existing_frame_rates]
for frame_rate in frame_rates_to_insert:
# Insert the frame rate
server.insert('twog/frame_rate', {'name': frame_rate})
示例3: main
def main():
config = ConfigParser.ConfigParser()
config.read('config.ini')
# Get credentials from config file
user = config.get('credentials', 'user')
password = config.get('credentials', 'password')
project = config.get('credentials', 'project')
# Just get the dev server URL for now
url = config.get('server', 'dev')
# Get a server object to perform queries
server = TacticServerStub(server=url, project=project, user=user, password=password)
# Set up a list of languages to insert
languages = ["Afar", "Abkhazian", "Afrikaans", "Akan", "Albanian", "Amharic", "Arabic", "Aragonese", "Armenian",
"Assamese", "Avaric", "Avestan", "Aymara", "Azerbaijani", "Bashkir", "Bambara", "Basque", "Belarusian",
"Bengali", "Bihari languages", "Bislama", "Tibetan", "Bosnian", "Breton", "Bulgarian", "Burmese",
"Catalan; Valencian", "Czech", "Chamorro", "Chechen", "Chinese",
"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic", "Chuvash",
"Cornish", "Corsican", "Cree", "Welsh", "Danish", "German", "Divehi; Dhivehi; Maldivian",
"Dutch; Flemish", "Dzongkha", "Greek, Modern (1453-)", "English", "Esperanto", "Estonian", "Ewe",
"Faroese", "Persian", "Fijian", "Finnish", "French", "Western Frisian", "Fulah", "Georgian",
"Gaelic; Scottish Gaelic", "Irish", "Galician", "Manx", "Guarani", "Gujarati",
"Haitian; Haitian Creole", "Hausa", "Hebrew", "Herero", "Hindi", "Hiri Motu", "Croatian", "Hungarian",
"Igbo", "Icelandic", "Ido", "Sichuan Yi; Nuosu", "Inuktitut", "Interlingue; Occidental",
"Interlingua (International Auxiliary Language Association)", "Indonesian", "Inupiaq", "Italian",
"Javanese", "Japanese", "Kalaallisut; Greenlandic", "Kannada", "Kashmiri", "Kanuri", "Kazakh",
"Central Khmer", "Kikuyu; Gikuyu", "Kinyarwanda", "Kirghiz; Kyrgyz", "Komi", "Kongo", "Korean",
"Kuanyama; Kwanyama", "Kurdish", "Lao", "Latin", "Latvian", "Limburgan; Limburger; Limburgish",
"Lingala", "Lithuanian", "Luxembourgish; Letzeburgesch", "Luba-Katanga", "Ganda", "Macedonian",
"Marshallese", "Malayalam", "Maori", "Marathi", "Malay", "Malagasy", "Maltese", "Mongolian", "Nauru",
"Navajo; Navaho", "Ndebele, South; South Ndebele", "Ndebele, North; North Ndebele", "Ndonga", "Nepali",
"Norwegian Nynorsk; Nynorsk, Norwegian", "Bokmal, Norwegian; Norwegian Bokmal", "Norwegian",
"Chichewa; Chewa; Nyanja", "Occitan (post 1500)", "Ojibwa", "Oriya", "Oromo", "Ossetian; Ossetic",
"Panjabi; Punjabi", "Pali", "Polish", "Portuguese", "Pushto; Pashto", "Quechua", "Romansh",
"Romanian; Moldavian; Moldovan", "Rundi", "Russian", "Sango", "Sanskrit", "Sinhala; Sinhalese",
"Slovak", "Slovenian", "Northern Sami", "Samoan", "Shona", "Sindhi", "Somali", "Sotho, Southern",
"Spanish; Latin", "Spanish; Castilian", "Sardinian", "Serbian", "Swati", "Sundanese", "Swahili",
"Swedish", "Tahitian", "Tamil", "Tatar", "Telugu", "Tajik", "Tagalog", "Thai", "Tigrinya",
"Tonga (Tonga Islands)", "Tswana", "Tsonga", "Turkmen", "Turkish", "Twi", "Uighur; Uyghur",
"Ukrainian", "Urdu", "Uzbek", "Venda", "Vietnamese", "Volapuk", "Walloon", "Wolof", "Xhosa", "Yiddish",
"Yoruba", "Zhuang; Chuang", "Zulu", "MLF", "Cantonese", "French Canadien", "Various",
"Mandarin Simplified", "French Parisian Dubbed", "Portuguese; Brazilian"]
# Get a list of already existing languages
existing_languages = server.eval('@SOBJECT(twog/language)')
existing_languages = [existing_language.get('name') for existing_language in existing_languages]
# Filter out the languages that are already in the database
languages_to_insert = [language for language in languages if language not in existing_languages]
for language in languages_to_insert:
# Insert the language
server.insert('twog/language', {'name': language})
示例4: init
def init(my):
from client.tactic_client_lib import TacticServerStub
from pyasm.common import Environment
my.server = TacticServerStub.get()
my.sk = ''
my.login = ''
my.order_code = ''
示例5: init
def init(my):
from client.tactic_client_lib import TacticServerStub
my.server = TacticServerStub.get()
my.login = Environment.get_login()
my.user = my.login.get_login()
my.work_order_code = ""
示例6: get_display
def get_display(my):
import re
from client.tactic_client_lib import TacticServerStub
from tactic.ui.panel import FastTableLayoutWdg
server = TacticServerStub.get()
sk = str(my.kwargs.get('sk'))
splits = sk.split('code=')
search_type = splits[0].split('?')[0];
code = splits[1];
search_id = re.findall(r'\d+', code)
search_id = int(search_id[0])
widget = DivWdg()
table = Table()
table.add_attr('class','snapshot_viewer_wdg')
table.add_attr('sk',sk)
#ftl = FastTableLayoutWdg(search_type='sthpw/snapshot', view='table', element_names='preview,process,description,web_path,timestamp,login', show_row_select=True, search_key=sk, show_gear=False, show_shelf=False, show_select=True, width='100%s' % '%', show_column_manager=False, expression="@UNION(@SOBJECT(sthpw/snapshot),@SOBJECT(sthpw/note.sthpw/snapshot))", temp=True)
if search_type == 'sthpw/note':
expression = "@SOBJECT(sthpw/snapshot)"
else:
expression="@UNION(@SOBJECT(sthpw/snapshot),@SOBJECT(sthpw/note.sthpw/snapshot))"
ftl = FastTableLayoutWdg(search_type='sthpw/snapshot', view='snapshot_by_process', show_row_select=True, search_key=sk, show_gear=False, show_shelf=False, show_select=True, height='300px', width='100%s' % '%', show_column_manager=False, expression=expression, temp=True)
table.add_row()
table.add_cell(ftl)
widget.add(table)
return widget
示例7: init
def init(my):
from client.tactic_client_lib import TacticServerStub
my.login_obj = Environment.get_login()
my.login = my.login_obj.get_login()
my.server = TacticServerStub.get()
my.login_obj = my.server.eval("@SOBJECT(sthpw/login['login','%s'])" % my.login)[0]
my.key_dict = {'highlight_notes': 'Highlight Notes - Record What I Have Seen (Slower)]:', 'show_note_counts': 'Show Top Section of Notes, Showing Count Breakdown:'}
示例8: init
def init(my):
my.server = TacticServerStub.get()
my.title = "Project"
my.sk = ''
my.code = ''
my.search_id = ''
my.parent_sk = ''
my.parent_sid = ''
my.order_sk = ''
my.x_butt = "<img src='/context/icons/common/BtnKill.gif' title='Delete' name='Delete'/>"
my.scratch_pipe = "<table border=0 cellspacing=0 cellpadding=2 style='font-size: 60%s; border-color: #FFFFFF; border-style: solid; border-width: 1px; cursor: pointer;'><tr><td align='center'><font color='#FFFFFF'>Pipeline</font></td></tr></table>" % '%'
my.width = '1000px'
my.height = '300px'
my.small = False
my.disp_mode = 'Small'
my.groups_str = ''
my.user = ''
my.is_master = False
my.is_master_str = 'false'
my.on_color = '#ff0000'
my.off_color = '#d9ed8b'
my.stat_colors = {
'Assignment': '#fcaf88',
'Pending': '#d7d7d7',
'In Progress': '#f5f3a4',
'In_Progress': '#f5f3a4',
'In Production': '#f5f3a4',
'In_Production': '#f5f3a4',
'In production': '#f5f3a4',
'In_production': '#f5f3a4',
'Waiting': '#ffd97f',
'Need Assistance': '#fc88fb',
'Need_Assistance': '#fc88fb',
'Review': '#888bfc',
'Approved': '#d4b5e7',
'On Hold': '#e8b2b8',
'On_Hold': '#e8b2b8',
'Client Response': '#ddd5b8',
'Completed': '#b7e0a5',
'Ready': '#b2cee8',
'Internal Rejection': '#ff0000',
'External Rejection': '#ff0000',
'Rejected': '#ff0000',
'Failed QC': '#ff0000',
'Fix Needed': '#c466a1',
'Need Buddy Check': '#e3701a',
'DR In_Progress': '#d6e0a4',
'DR In Progress': '#d6e0a4',
'Amberfin01_In_Progress':'#D8F1A8',
'Amberfin01 In Progress':'#D8F1A8',
'Amberfin02_In_Progress':'#F3D291',
'Amberfin02 In Progress':'#F3D291',
'BATON In_Progress': '#c6e0a4',
'BATON In Progress': '#c6e0a4',
'Export In_Progress': '#796999',
'Export In Progress': '#796999',
'Buddy Check In_Progress': '#1aade3',
'Buddy Check In Progress': '#1aade3'
}
示例9: init
def init(my):
from client.tactic_client_lib import TacticServerStub
my.server = TacticServerStub.get()
my.login = Environment.get_login()
my.user = my.login.get_login()
my.task_code = ''
my.task_codes = ''
my.code = ''
示例10: __init__
def __init__(my, **kwargs):
from client.tactic_client_lib import TacticServerStub
from pyasm.common import Environment
super(ClipboardEmptySearchTypeCmd, my).__init__(**kwargs)
my.login = Environment.get_login()
my.user_name = my.login.get_login()
my.server = TacticServerStub.get()
my.search_type = str(kwargs.get('search_type'))
示例11: _test_csv_export
def _test_csv_export(self):
from tactic.ui.widget import CsvExportWdg
view = 'table'
search_type ='sthpw/task'
search_view = 'auto_search:table'
#search_view = ''
simple_search_view = 'simple_search'
search_class =''
mode = 'export_matched'
element_name= 'project_tasks'
filter = [{"prefix":"main_body","main_body_enabled":"on","main_body_column":"project_code","main_body_relation":"is","main_body_value":"{$PROJECT}"}, {"prefix":"main_body","main_body_enabled":"on","main_body_column":"search_type","main_body_relation":"is not","main_body_value":"sthpw/project"}]
from pyasm.common import jsondumps, jsonloads
values = {'json': jsondumps(filter)}
element_names = ['code','id','description']
server = TacticServerStub(protocol='xmlrpc')
current_project = 'vfx'
server.set_project(current_project)
rtn = server.get_widget('tactic.ui.widget.CsvExportWdg', args={'search_type':search_type, 'view':view,\
'filter': filter, 'element_name': element_name, 'show_search_limit':'false', 'search_limit':-1, 'search_view':search_view, \
'element_names': element_names, 'mode':mode, 'search_class':search_class, 'simple_search_view':simple_search_view,\
'init_load_num':-1, 'test':True}, values=values )
expected_columns = ['code','id','description']
expected_sql = '''SELECT "sthpw"."public"."task".* FROM "sthpw"."public"."task" WHERE ( "task"."project_code" = \'%s\' AND ( "task"."search_type" != \'sthpw/project\' OR "task"."search_type" is NULL ) ) AND ("task"."s_status" != \'retired\' or "task"."s_status" is NULL) AND ("task"."s_status" != \'retired\' or "task"."s_status" is NULL) AND ("task"."s_status" != \'retired\' or "task"."s_status" is NULL) ORDER BY "task"."search_type", "task"."search_code"'''%current_project
expr = "@COUNT(sthpw/task['project_code','%s']['search_type','!=','sthpw/project])"%current_project
expected_count = Search.eval(expr, single=True)
rtn = jsonloads(rtn)
self.assertEquals(expected_columns, rtn.get('columns'))
self.assertEquals(expected_sql, rtn.get('sql'))
self.assertEquals(expected_count, rtn.get('count'))
mode = 'export_displayed'
selected_search_keys = ['sthpw/task?id=4385','sthpw/task?id=4386','sthpw/task?id=4387']
rtn = server.get_widget('tactic.ui.widget.CsvExportWdg', args={'search_type':search_type, 'view':view,\
'filter': filter, 'element_name': element_name, 'show_search_limit':'false', 'search_limit':-1, 'search_view':search_view, \
'element_names': element_names, 'mode':mode, 'search_class':search_class, 'simple_search_view':simple_search_view,\
'init_load_num':-1, 'test':True, 'selected_search_keys': selected_search_keys}, values=values )
expected_count = 3
rtn = jsonloads(rtn)
self.assertEquals(expected_columns, rtn.get('columns'))
self.assertEquals(expected_count, rtn.get('count'))
示例12: init
def init(my):
from client.tactic_client_lib import TacticServerStub
from pyasm.common import Environment
my.server = TacticServerStub.get()
my.number = 0
my.code = ''
my.login = Environment.get_login()
my.user = my.login.get_login()
my.width = '1000px'
my.height = '300px'
示例13: init
def init(my):
my.server = TacticServerStub.get()
my.sk = ''
my.search_id = ''
my.code = ''
my.user = ''
my.groups_str = ''
my.parent_sk = ''
my.parent_sid = ''
my.order_sk = ''
my.disp_mode = 'Small'
my.small = False
my.is_master = False
my.is_master_str = 'false'
my.on_color = '#ff0000'
my.off_color = '#c6eda0'
my.stat_colors = {
'Assignment': '#fcaf88',
'Pending': '#d7d7d7',
'In Progress': '#f5f3a4',
'In_Progress': '#f5f3a4',
'In Production': '#f5f3a4',
'In_Production': '#f5f3a4',
'In production': '#f5f3a4',
'In_production': '#f5f3a4',
'Waiting': '#ffd97f',
'Need Assistance': '#fc88fb',
'Need_Assistance': '#fc88fb',
'Review': '#888bfc',
'Approved': '#d4b5e7',
'On Hold': '#e8b2b8',
'On_Hold': '#e8b2b8',
'Client Response': '#ddd5b8',
'Completed': '#b7e0a5',
'Ready': '#b2cee8',
'Internal Rejection': '#ff0000',
'External Rejection': '#ff0000',
'Rejected': '#ff0000',
'Failed QC': '#ff0000',
'Fix Needed': '#c466a1',
'Need Buddy Check': '#e3701a',
'DR In_Progress': '#d6e0a4',
'DR In Progress': '#d6e0a4',
'Amberfin01_In_Progress':'#D8F1A8',
'Amberfin01 In Progress':'#D8F1A8',
'Amberfin02_In_Progress':'#F3D291',
'Amberfin02 In Progress':'#F3D291',
'BATON In_Progress': '#c6e0a4',
'BATON In Progress': '#c6e0a4',
'Export In_Progress': '#796999',
'Export In Progress': '#796999',
'Buddy Check In_Progress': '#1aade3',
'Buddy Check In Progress': '#1aade3'
}
示例14: init
def init(my):
my.group_list = Environment.get_group_names()
login = Environment.get_login()
my.user = login.get_login()
my.server = TacticServerStub.get()
my.sk = ''
my.code = ''
my.st = ''
my.is_scheduler = False
for gname in my.group_list:
if 'scheduling' in gname:
my.is_scheduler = True
if my.user == 'admin':
my.is_scheduler = True
示例15: get_display
def get_display(my):
import time, datetime
from tactic_client_lib import TacticServerStub
from pyasm.common import Environment
code = ''
fault_files = None
rowct = 1
server = TacticServerStub.get()
if 'external_rejection_code' in my.kwargs.keys():
code = my.kwargs.get('external_rejection_code')
fault_files = server.eval("@SOBJECT(twog/external_rej_at_fault_files['external_rejection_code','%s'])" % code)
if 'rowct' in my.kwargs.keys():
rowct = int(my.kwargs.get('rowct'))
adding = False
if 'adding' in my.kwargs.keys():
if my.kwargs.get('adding') == 'true':
adding = True
table = Table()
table.add_attr('class','fftable')
table.add_attr('border','1')
if rowct == 1 and not adding:
table.add_row()
table.add_cell("<b>List of At-Fault Files:</b>")
if code not in [None,''] and not adding:
for ff in fault_files:
brow = table.add_row()
brow.add_attr('line',rowct)
brow.add_attr('code',ff.get('code'))
brow.add_attr('prev',ff.get('file_path'))
brow.add_attr('sk',ff.get('__search_key__'))
brow.add_attr('class','fault_files')
table.add_cell(my.txtbox('file_path-%s' % rowct, ff.get('file_path'),width='700px'))
killer = table.add_cell('<b>X</b>')#This must delete the entry
killer.add_style('cursor: pointer;')
killer.add_behavior(my.get_kill_bvr(rowct, code, ff.get('code')))
rowct = rowct + 1
erow = table.add_row()
erow.add_attr('line',rowct)
erow.add_attr('code','')
erow.add_attr('prev','')
erow.add_attr('sk','')
erow.add_attr('class','fault_files')
table.add_cell(my.txtbox('file_path-%s' % rowct, '',width='700px'))
addnew = table.add_cell('<b>+</b>')#This must add new entry
addnew.add_style('cursor: pointer;')
addnew.add_behavior(my.get_add_line(rowct, code, ''))
erow2 = table.add_row()
erow2.add_attr('class','new_ff_line')
return table