本文整理汇总了Python中shotgun_api3.Shotgun.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Shotgun.delete方法的具体用法?Python Shotgun.delete怎么用?Python Shotgun.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shotgun_api3.Shotgun
的用法示例。
在下文中一共展示了Shotgun.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Shotgun
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import delete [as 别名]
'''
Call this script from the command line as python delete_actionmenu.py
***you MUST know the ID of the action menu you want to delete and enter it below
This is a very stupid script and is provided as a utility only
Documentation to come - note that you will have to write a find routine to find the
correct ID to delete!
Author Tom Stratton / tom at tomstratton dot net
'''
from shotgun_api3 import Shotgun
from pprint import pprint
SERVER_PATH = 'https://*****.shotgunstudio.com' #your server path here
SCRIPT_USER = '********' #your script name
SCRIPT_KEY = '********' #your key here
sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
ID_TO_DELELE = 1
sg.delete('ActionMenuItem', ID_TO_DELELE)
# note that the id numbers will have to be either found or remembered!
示例2: Shotgun
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import delete [as 别名]
config = blob['config']
payload = blob['data']
sg = Shotgun(config['shotgun_url'], config['script_name'], config['script_api_key'], 'api3_preview')
if method == 'find':
result = sg.find(payload['entity'], payload['filters'], payload['fields'], payload['order'], payload['filter_operator'], payload['limit'], payload['retired_only'])
elif method == 'find_one':
result = sg.find_one(payload['entity'], payload['filters'], payload['fields'], payload['order'], payload['filter_operator'])
elif method == 'create':
result = sg.create(payload['entity'], payload['data'])
elif method == 'update':
result = sg.update(payload['entity'], payload['id'], payload['data'])
elif method == 'delete':
result = sg.delete(payload['entity'], payload['id'])
elif method == 'upload':
result = sg.upload(payload['entity'], payload['id'], payload['path'], payload['field_name'], payload['display_name'])
elif method == 'upload_thumbnail':
result = sg.upload_thumbnail(payload['entity'], payload['id'], payload['path'])
elif method == 'schema_field_read':
result = sg.schema_field_read(payload['entity'])
elif method == 'schema_field_create':
result = sg.schema_field_create(payload['entity'], payload['type'], payload['name'], payload['attrs'])
elif method == '_url_for_attachment_id':
entity_id = payload['id']
# Do a lot of legwork (based on Shotgun.download_attachment())
sid = sg._get_session_token()
domain = urlparse(sg.base_url)[1].split(':',1)[0]
cj = cookielib.LWPCookieJar()