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


Python Shotgun.authenticate_human_user方法代碼示例

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


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

示例1: dMFXsubmitterDialog

# 需要導入模塊: from shotgun_api3 import Shotgun [as 別名]
# 或者: from shotgun_api3.Shotgun import authenticate_human_user [as 別名]

#.........這裏部分代碼省略.........
            self.user_initials = ''
            self.lineEdit_initials.setText('')

        # check to see if the version file is a movie and, if so and the movie line is empty, fill that in
        if self.version_file_path and os.path.splitext(str(self.version_file_path).lower())[1] in MOVIE_FILE_EXTENSION_LIST and not self.movie_file_path:
            self.movie_file_path = str(self.version_file_path)
            self.lineEdit_forReview.setText(self.movie_file_path)

        # check for conditions that allow an update to happen
        conditions = True # start by assuming we can go and switch if we can't
        if self.user in INITIALS_LIST and not self.user_initials:
            conditions = False
        if conditions and not self.login_status:
            conditions = False
        if conditions and self.version_file_path and not os.path.exists(self.version_file_path):
            conditions = False
        if conditions and self.submit_movie:
            if self.movie_file_path and not os.path.exists(self.movie_file_path):
                conditions = False
            if not self.movie_file_path:
                conditions = False

        #enable the submit button if appropriate
        if conditions:
            self.pushButton_submit.setEnabled(True)
            self.pushButton_submit.setDefault(True)
        else:
            self.pushButton_submit.setEnabled(False)


    # self.pushButton_login
    @pyqtSignature("") 
    def on_pushButton_login_clicked(self):
        result = self.sgu.authenticate_human_user(self.user_name, self.lineEdit_password.text())
        if result:
            self.login_status = True
        else:
            # user tried to log in and failed - let them know
            QMessageBox.about(self, "Log In Error", "Unable to login to Shotgun using your user/pass combination, please try again")
        self.updateUI()

    # self.pushButton_getVersionFile
    @pyqtSignature("")
    def on_pushButton_getVersionFile_clicked(self):
        self.version_file_path = str(QFileDialog.getOpenFileName(self, "Select the file to submit as a Version"   ))
        if self.version_file_path:
            self.lineEdit_versionFile.setText(self.version_file_path)
        self.updateUI()

    # self.pushButton_getForReview
    @pyqtSignature("") 
    def on_pushButton_getForReview_clicked(self):
        self.movie_file_path = str(QFileDialog.getOpenFileNameAndFilter(self, "Select a movie file to submit for screening",
                                   filter= "Movies ( *.mp4 *.mov)")[0]) # the getopenfile returns a tuple of length 2
        if self.movie_file_path:
            self.lineEdit_forReview.setText(self.movie_file_path)
        self.updateUI()

    # self.pushButton_quit
    @pyqtSignature("")
    def on_pushButton_quit_clicked(self):
        QApplication.quit()

    # self.checkBox_forReview
    @pyqtSignature("bool")
    def on_checkBox_forReview_clicked(self):
開發者ID:ProjectGuerilla,項目名稱:Code-Samples,代碼行數:70,代碼來源:dMFXsubmitter.py


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