本文整理汇总了Python中client.tactic_client_lib.TacticServerStub.insert方法的典型用法代码示例。如果您正苦于以下问题:Python TacticServerStub.insert方法的具体用法?Python TacticServerStub.insert怎么用?Python TacticServerStub.insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client.tactic_client_lib.TacticServerStub
的用法示例。
在下文中一共展示了TacticServerStub.insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from client.tactic_client_lib import TacticServerStub [as 别名]
# 或者: from client.tactic_client_lib.TacticServerStub import insert [as 别名]
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
# 需要导入模块: from client.tactic_client_lib import TacticServerStub [as 别名]
# 或者: from client.tactic_client_lib.TacticServerStub import insert [as 别名]
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
# 需要导入模块: from client.tactic_client_lib import TacticServerStub [as 别名]
# 或者: from client.tactic_client_lib.TacticServerStub import insert [as 别名]
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: main
# 需要导入模块: from client.tactic_client_lib import TacticServerStub [as 别名]
# 或者: from client.tactic_client_lib.TacticServerStub import insert [as 别名]
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 territories to insert. These are all the territories that previously existed in TACTIC
territories = ['Afghanistan', 'Aland Islands', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola',
'Anguilla', 'Antigua and Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria',
'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize',
'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bonaire', 'Bosnia and Herzegovina', 'Botswana',
'Bouvet Island', 'Brazil', 'Brunei Darussalam', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia',
'Cameroon', 'Canada', 'Cantonese', 'Cape Verde', 'Cayman Islands', 'Central African Republic',
'Chad', 'Chile', 'China', 'Christmas Island', 'Cocos Islands', 'Colombia', 'Comoros', 'Congo',
'Dem. Rep. of Congo', 'Cook Islands', 'Costa Rica', 'Croatia', 'Cuba', 'Curacao', 'Cyprus', 'Czech',
'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic', 'Ecuador', 'Egypt', 'El Salvador',
'English', 'Equatorial Guinea', 'Eritrea', 'Estonia', 'Ethiopia', 'Falkland Islands',
'Faroe Islands', 'Fiji', 'Finland', 'France', 'French Guiana', 'French Polynesia', 'Gabon', 'Gambia',
'Georgia', 'Germany', 'Ghana', 'Gibraltar', 'Greece', 'Greek', 'Greenland', 'Grenada', 'Guadeloupe',
'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', 'Haiti', 'Honduras',
'Hong Kong', 'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Isle of Man',
'Israel', 'Italy', 'Ivory Coast', 'Jamaica', 'Japan', 'Jersey', 'Jordan', 'Kazakhstan', 'Kenya',
'Kiribati', 'Kuwait', 'Kyrgyztan', 'Laos', 'Latin America', 'Latin Spanish', 'Latvia', 'Lebanon',
'Lesotho', 'Liberia', 'Libya', 'Liechtenstein', 'Lithuania', 'Luzembourg', 'Macao', 'Macedonia',
'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Martinique',
'Mauritania', 'Mauritius', 'Mayotte', 'Mexico', 'Micronesia', 'Moldova', 'Monaco', 'Mongolia',
'Montenegro', 'Montserrat', 'Morocco', 'Mozambique', 'Multi-language', 'Myanmar', 'Namibia', 'Nauru',
'Nepal', 'Netherlands', 'New Caledonia', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'Niue',
'Norfolk Island', 'North Korea', 'Northern Mariana Islands', 'Norway', 'Oman', 'Pakistan', 'Palau',
'Palestine', 'Panama', 'Papua New Guinea', 'Pan-Asia', 'Paraguay', 'Peru', 'Philippines', 'Pitcairn',
'Poland', 'Portugal', 'Puerto Rico', 'Qatar', 'Reunion', 'Romania', 'Russia', 'Russian', 'Rwanda',
'St Barthelemy', 'St Helena', 'St Kitts and Nevis', 'St Lucia', 'St Martin', 'St Pierre and Miquelo',
'St Vincent and Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Saudi Arabia',
'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Signapore', 'Sint Maarten', 'Slovakia',
'Slovenia', 'Solomon Islands', 'Somalia', 'South Africa', 'South Georgia and Swch Islands',
'South Korea', 'South Sudan', 'Spain', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard', 'Swaziland',
'Sweden', 'Switzerland', 'Syria', 'Taiwan', 'Tajikistan', 'Tanzania', 'Thai', 'Thailand',
'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad and Tobago', 'Tunisia', 'Turkey',
'Turkmenistan', 'Turks and Caicos Islands', 'Tuvalu', 'Uganda', 'Ukraine', 'UAE', 'United Kingdom',
'United States', 'Uruguay', 'Uzbekistan', 'Vanuatu', 'Various', 'Vatican', 'Venezuela', 'Vietnam',
'Virgin Islands', 'Wallis and Futuna', 'West Indies', 'Western Sahara', 'Yemen', 'Zambia',
'Zimbabwe']
# Get a list of already existing territories
existing_territories = server.eval('@SOBJECT(twog/territory)')
existing_territories = [existing_territory.get('name') for existing_territory in existing_territories]
# Filter out the territories that are already in the database
territories_to_insert = [territory for territory in territories if territory not in existing_territories]
print(territories_to_insert)
for territory in territories_to_insert:
# Insert the territory
server.insert('twog/territory', {'name': territory})