当前位置: 首页>>代码示例>>Python>>正文


Python ProgressBar.setRange方法代码示例

本文整理汇总了Python中ProgressBar.ProgressBar.setRange方法的典型用法代码示例。如果您正苦于以下问题:Python ProgressBar.setRange方法的具体用法?Python ProgressBar.setRange怎么用?Python ProgressBar.setRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProgressBar.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.setRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DataSelector

# 需要导入模块: from ProgressBar import ProgressBar [as 别名]
# 或者: from ProgressBar.ProgressBar import setRange [as 别名]
class DataSelector(QtGui.QWidget):
    def __init__(self, repo_path):
        super(DataSelector,self).__init__()
        self.repo_path = repo_path
        self.data_from_fk = None
        self.createUI()
        self.fk_retriever = FKRetriever(self.repo_path)
        self.mapEvents()
        self.data_is_ready = False
        self.data = None
        self.validate_button.setEnabled(False)

    def createUI(self):
        self.group_box = QtGui.QGroupBox("Data Selector")
        self.page_selector = IconListBox()
        page_control_list = [
                    {
                    "Name": "From Flipkart Using FSNs",
                    "Icon": os.path.join("essentials","download.png")
                    },
                    {
                    "Name": "From CSV Data File",
                    "Icon": os.path.join("essentials","csv_file.png")
                    }
                ]
        self.page_selector.addElements(page_control_list)
        self.page_selector.setFixedSize(302,110)
        #FSN Mode Widget
        self.fsn_mode_widget = QtGui.QGroupBox("Data By FSN")
        self.fsn_text_edit = FSNTextEdit()
        self.fsn_text_edit.setFixedSize(450,400)
        self.category_label = QtGui.QLabel("Category:")
        self.category_combo_box = QtGui.QComboBox()
        self.category_combo_box.addItems(getCategoryFolderNames()) #Later, add this data from OINK's server.        
        self.category_combo_box.setToolTip("Select the default category for the given FSNs.\nNote that mixing various types of FSNs isn't recommended.\nThe icons won't load.")
        self.attributes_list_box = QtGui.QListWidget()
        self.attributes_list_box.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
        self.attributes_list_box.setToolTip("Displays all product attributes, obtained from the FK server.")
        self.primary_attributes_list_box = QtGui.QListWidget()
        self.primary_attributes_list_box.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
        self.primary_attributes_list_box.setToolTip("Displays primary product attributes that you have selected.")
        self.secondary_attributes_list_box = QtGui.QListWidget()
        self.secondary_attributes_list_box.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
        self.secondary_attributes_list_box.setToolTip("Displays secondary product attributes that you have selected.")
        self.push_to_primary_button = QtGui.QPushButton("Add to\nPrimary List")
        self.push_to_primary_button.setToolTip("Click to move the chosen attribute into the list of primary attributes.")
        self.remove_from_primary_button = QtGui.QPushButton("Remove from\nPrimary List")
        self.remove_from_primary_button.setToolTip("Click to move the chosen attribute out of the list of primary attributes.")
        self.push_to_secondary_button = QtGui.QPushButton("Add to\nSecondary List")
        self.push_to_secondary_button.setToolTip("Click to move the chosen attribute into the list of secondary attributes.")
        self.remove_from_secondary_button = QtGui.QPushButton("Remove from\nSecondary List")
        self.remove_from_secondary_button.setToolTip("Click to move the chosen attribute out of the list of secondary attributes.")
        #downloader
        self.fetch_images_attributes_button = QtGui.QPushButton("Download")
        self.fetch_images_attributes_button.setToolTip("This will check if parent images are available for all the FSNs and download them if necessary from the FK site. It will also load the spec table.")
        self.export_scraped_data_button = QtGui.QPushButton("Export Data")
        self.fetching_progress = ProgressBar()
        self.fetching_progress.setRange(0,100)
        self.fetching_progress.setValue(0)
        self.fetching_activity = QtGui.QLabel("All that is gold does not glitter!")
        self.fetching_activity.setStyleSheet("QLabel{font: 10px black; border: 1px solid black;}")
        self.fetching_activity.setToolTip("This indicates the current downloader's activity, or some random quote that Vinay thinks is funny.")
        self.completed_fsns_count_label = QtGui.QLabel("Completed:")
        self.completed_fsns_count_spinbox = QtGui.QSpinBox()
        self.completed_fsns_count_spinbox.setEnabled(False)
        self.eta_label = QtGui.QLabel("ETA:")
        self.eta_datetimeedit = QtGui.QDateTimeEdit()
        self.eta_datetimeedit.setEnabled(False)
        self.eta_datetimeedit.setMinimumDateTime(QtCore.QDateTime(datetime.datetime.now()))
        self.activity_log_textedit = QtGui.QTextEdit()
        self.activity_log_textedit.setReadOnly(True)
        self.pending_fsns_count_label = QtGui.QLabel("Pending:")
        self.pending_fsns_count_spinbox = QtGui.QSpinBox()
        self.pending_fsns_count_spinbox.setEnabled(False)
        self.failed_fsns_label = QtGui.QLabel("Failed:")
        self.failed_fsns_count_spinbox = QtGui.QSpinBox()
        self.failed_fsns_count_spinbox.setEnabled(False)

        self.completed_fsns_count_spinbox.setRange(0,99999999)
        self.pending_fsns_count_spinbox.setRange(0,99999999)
        self.failed_fsns_count_spinbox.setRange(0,99999999)

        self.pending_fsns_list_text_edit = QtGui.QTextEdit()
        self.pending_fsns_list_text_edit.setReadOnly(True)
        self.completed_fsns_list_text_edit = QtGui.QTextEdit()
        self.completed_fsns_list_text_edit.setReadOnly(True)
        self.failed_fsns_list_text_edit = QtGui.QTextEdit()
        self.failed_fsns_list_text_edit.setReadOnly(True)

        buttons_and_progress_bar = QtGui.QHBoxLayout()
        buttons_and_progress_bar.addWidget(self.fetch_images_attributes_button, 2)
        buttons_and_progress_bar.addWidget(self.export_scraped_data_button, 1)
        buttons_and_progress_bar.addWidget(self.fetching_progress, 4)

        completed_tracking = QtGui.QVBoxLayout()
        completed_tracking.addWidget(self.completed_fsns_count_label)
        completed_tracking.addWidget(self.completed_fsns_count_spinbox)
        completed_tracking.addWidget(self.completed_fsns_list_text_edit)
        
        eta_layout = QtGui.QHBoxLayout()
#.........这里部分代码省略.........
开发者ID:vinay87,项目名称:leonardo,代码行数:103,代码来源:DataSelector.py

示例2: DailyPorker

# 需要导入模块: from ProgressBar import ProgressBar [as 别名]
# 或者: from ProgressBar.ProgressBar import setRange [as 别名]

#.........这里部分代码省略.........
        self.build_dbr_button.clicked.connect(self.buildDBR)
        self.build_wbr_button.clicked.connect(self.buildWBR)

    def buildDBR(self):
        self.build_dbr_button.setEnabled(False)
        self.alertMessage("Please Wait","This could take a while.")
        dbr = MOSES.getDBR(self.user_id, self.password, self.start_date_edit.date().toPyDate(), self.category_tree)
        self.dbr_report.showDataFrame(dbr)
        self.dbr_report.adjustToColumns()
        self.build_dbr_button.setEnabled(True)
        self.alertMessage("Success","Successfully Pulled the DBR")

    def buildWBR(self):
        self.build_wbr_button.setEnabled(False)
        self.alertMessage("Please Wait","This could take a while.")
        wbr = MOSES.getWBR(self.user_id, self.password, self.start_date_edit.date().toPyDate(), self.category_tree)
        self.wbr_report.showDataFrame(wbr)
        self.wbr_report.adjustToColumns()
        self.build_wbr_button.setEnabled(True)
        self.alertMessage("Success","Successfully Pulled the WBR")


    def getWritersList(self):
        self.writers_data_frame = MOSES.getWritersList(self.user_id, self.password, self.start_date_edit.date().toPyDate())
        writer_names_list = list(set(self.writers_data_frame["Name"]))
        writer_names_list.sort()
        return writer_names_list

    def displayGraphs(self,handle):
        if handle:
            self.graphs.graph_date = self.pork_lane.start_date
            self.graphs.enable_plotting = True
            self.graphs.plotGraph()
            self.progress_bar.setRange(0,100)
            self.progress_bar.setFormat("Completed at %s." %(datetime.datetime.strftime(datetime.datetime.now(),"%H:%M:%S")))
            self.status.setText("Beware the alien, the mutant, the heretic.")  
            self.progress_bar.setValue(100)
            #self.export_graphs_button.setEnabled(True)
        else:
            self.export_graphs_button.setEnabled(False)
            self.status.setText("Creating Graphs...")        
            self.progress_bar.setValue(0)
            self.progress_bar.setRange(0,0)


    def refreshSortFilter(self):
        report_types = self.getRequiredReportTypes()
        self.sorting_filter_combobox.clear()
        if len(report_types) > 0:
            self.sorting_filter_combobox.setEnabled(True)
            self.sorting_filter_combobox.addItems(report_types)
        else:
            self.sorting_filter_combobox.setEnabled(False)
        self.sorting_filter_combobox.setCurrentIndex(-1)

    def buildReport(self):
        self.build_button.setEnabled(False)
        report_types = self.getRequiredReportTypes()
        if len(report_types) > 0:
            self.build = True
            self.pork_lane.writers_data_frame = self.writers_data_frame
            self.pork_lane.parameter_list = self.parameters_combobox.getCheckedItems() #set pork lane report types.]
            self.pork_lane.time_frame_list = self.report_time_frames_combobox.getCheckedItems()
            selected_writers_list = self.writers_combobox.getCheckedItems()
            if len(selected_writers_list)>0:
                self.pork_lane.writers_list = selected_writers_list
开发者ID:vinay87,项目名称:oink,代码行数:70,代码来源:DailyPorker.py


注:本文中的ProgressBar.ProgressBar.setRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。