本文整理匯總了Python中movie.Movie.original_file_name方法的典型用法代碼示例。如果您正苦於以下問題:Python Movie.original_file_name方法的具體用法?Python Movie.original_file_name怎麽用?Python Movie.original_file_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類movie.Movie
的用法示例。
在下文中一共展示了Movie.original_file_name方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: load_movies_run
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import original_file_name [as 別名]
def load_movies_run(self, filepaths):
renaming_rule = utils.preferences.value("renaming_rule").toString()
# loop on file paths
for filepath in filepaths:
# set loading label text, show current file name
self.ui.label_loading.setText(QApplication.translate('GUI', "Getting information from ")\
+ os.path.split(filepath)[1])
# create a new movie object
movie = Movie(filepath)
# generate new movie name based on renaming rule
movie.generate_new_name(renaming_rule)
# add movie to list
self.movies.append(movie)
# insert a new row in movie table
self.ui.table_movies.insertRow(self.ui.table_movies.rowCount())
# create a table item with original movie file name
item_original_name = QTableWidgetItem(movie.original_file_name())
item_original_name.setForeground(QBrush(Qt.black))
self.ui.table_movies.setItem(self.ui.table_movies.rowCount() - 1, 0, item_original_name)
# create a table item with new movie file name
item_new_name = QTableWidgetItem(movie.new_file_name())
item_new_name.setForeground(QBrush(Qt.black))
self.ui.table_movies.setItem(self.ui.table_movies.rowCount() - 1, 1, item_new_name)
self.load_movies_finished.emit()