當前位置: 首頁>>代碼示例>>Python>>正文


Python Shotgun.delete方法代碼示例

本文整理匯總了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!
開發者ID:ProjectGuerilla,項目名稱:Shotgun-Code-Snippets,代碼行數:29,代碼來源:delete_actionmenu.py

示例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()
開發者ID:jmah,項目名稱:cinesync_shotgun,代碼行數:32,代碼來源:shotgun_slave.py


注:本文中的shotgun_api3.Shotgun.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。