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


Python Shotgun.__init__方法代碼示例

本文整理匯總了Python中shotgun_api3.Shotgun.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Shotgun.__init__方法的具體用法?Python Shotgun.__init__怎麽用?Python Shotgun.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在shotgun_api3.Shotgun的用法示例。


在下文中一共展示了Shotgun.__init__方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from shotgun_api3 import Shotgun [as 別名]
# 或者: from shotgun_api3.Shotgun import __init__ [as 別名]
    def __init__(self, base_url, script_name, api_key, convert_datetimes_to_utc=True,
        http_proxy=None, ensure_ascii=True, connect=True, host=None, port=None):
        '''
        We will initialize the Shotgun object, but will not connect right away.
        Instead it will will attempt to create a socket connection using the
        Shotgun object and the host and port data provided or generated. If we do
        not have a host and port specified, or do not find a connection, we will
        fall back and connect to the actual Shotgun server instead.
        '''
        Shotgun.__init__(self, base_url, script_name, api_key,
            convert_datetimes_to_utc=convert_datetimes_to_utc,
            http_proxy=http_proxy, ensure_ascii=ensure_ascii,
            connect=False)

        # If a host is not specified, attempt using the local machine.
        if not host:
            host = socket.gethostname()

        # If a port is not specified, generate a port from the app key.
        if not port:
            port = common.appKeyToPort(self.config.api_key)

        self._sgclient = None
        self._host = host
        self._port = port

        if connect:
            self.connect()
開發者ID:Mathieson,項目名稱:DoubleBarrel,代碼行數:30,代碼來源:wrapper.py


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