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


Python MOSES.getEmpName方法代码示例

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


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

示例1: submit

# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getEmpName [as 别名]
    def submit(self):
        """Leave Planner: Method to send the request to the work calendar table."""
        startDate = self.start_date_edit.date().toPyDate()
        endDate = self.end_date_edit.date().toPyDate()
        status = str(self.statusComboBox.currentText())
        relaxation = self.relaxationSpinBox.value() #Test this.
        relaxation = float(relaxation)/100.00
        comment = str(self.commentLineEdit.text())

        dates_list = [startDate, endDate]
        name = MOSES.getEmpName(self.user_id)

        self.alertMessage("Please Wait","This process could take a while, and OINK will appear like it has hung. Rest assured that it's running in the background. Please be patient, %s."%name)
        success = MOSES.askForModWorkCalendar(self.user_id, self.password, dates_list, status, relaxation, comment, name)
        if success:
            self.alertMessage("Success", "Your request has been submitted to the server. Ask your TL to approve the request.")
        else:
            self.alertMessage("Failed", "Your request could not be submitted. Ask your TL to manually mark your leaves in the server.")
开发者ID:vinay87,项目名称:oink,代码行数:20,代码来源:LeavePlanner.py

示例2: createUI

# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getEmpName [as 别名]
    def createUI(self):
        """"""
        path_to_images = MOSES.getPathToImages()
        self.raw_data_uploader_button = ImageButton(
                                                os.path.join(path_to_images,"upload_raw_data.png"),
                                                48,
                                                48, os.path.join(path_to_images,"upload_raw_data_mouseover.png"))
        self.tna_viewer_button = ImageButton(
                                                os.path.join(path_to_images,"tna.png"),
                                                48,
                                                48,
                                                os.path.join(path_to_images,"tna_mouseover.png")
                                                )
        self.piggybank_button = ImageButton(
                                                os.path.join(path_to_images,"piggybank.png"),
                                                48,
                                                48,
                                                os.path.join(path_to_images,"piggybank_mouseover.png")
                                                )
        self.seeker_button = ImageButton(
                                                os.path.join(path_to_images,"find.png"),
                                                48,
                                                48,
                                                os.path.join(path_to_images,"find_mouseover.png")
                                                )

        self.taunter = Taunter()
        self.bacon_icon = ImageButton(
                                                os.path.join(path_to_images,"quality.png"),
                                                150,
                                                150,
                                                os.path.join(path_to_images,"quality_mouseover.png")
                                                )
        self.bacon_icon.setToolTip("Get to work, Poozers.")
        
        row_1 = QtGui.QHBoxLayout()
        row_1.addWidget(self.raw_data_uploader_button)
        row_1.addWidget(self.tna_viewer_button)
        row_1.addWidget(self.piggybank_button)
        row_1.addWidget(self.seeker_button)
        layout = QtGui.QVBoxLayout()
        layout.addWidget(self.bacon_icon,0,QtCore.Qt.AlignHCenter)
        layout.addLayout(row_1,1)
        layout.addWidget(self.taunter,0)

        self.main_widget = QtGui.QWidget()
        self.main_widget.setLayout(layout)
        self.setCentralWidget(self.main_widget)
        self.setWindowTitle("BACON - Version %s. Server: %s. User: %s (%s)."%(version(), MOSES.getHostID(), self.user_id,MOSES.getEmpName(self.user_id) if self.user_id != "bigbrother" else "Administrator"))
        icon_file_name_path = os.path.join(path_to_images,'PORK_Icon.png')
        self.setWindowIcon(QtGui.QIcon(icon_file_name_path))
        self.show()
开发者ID:vinay87,项目名称:oink,代码行数:54,代码来源:Bacon.py

示例3: plotPareto

# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getEmpName [as 别名]
    def plotPareto(self, audit_parameter_selection):
        #print self.audit_parameters_dataframe
        parameter_column_names = self.getParameterColumnNames(audit_parameter_selection)
        parameter_class_list = [x[:(len(x)-2)] for x in parameter_column_names]
        #self.printMessage(parameter_column_names)
        parameter_summary_data = []
        counter = 0
        for parameter in audit_parameter_selection:
            parameter_column_name = parameter_column_names[counter]
            if not self.use_minimum_acceptable_scores.isChecked():
                acceptable_score = self.getMaximumScoreForParameter(parameter)
            else:
                acceptable_score = self.getMinimumScoreForParameter(parameter)
            #if "FAT" in parameter_column_name:
            #    self.printMessage("%s-%s: Max. Score: %s"%(parameter_column_name, parameter, acceptable_score))
            if type(acceptable_score) == str:
                #The acceptable score can be a string or a number.
                base_deviant_positions = self.base_data_set[parameter_column_name] != acceptable_score
            else:
                base_deviant_positions = self.base_data_set[parameter_column_name] < acceptable_score

            base_deviation_frequency = self.base_data_set[base_deviant_positions][parameter_column_name].count()
            base_deviation_frequency_percentage = base_deviation_frequency/self.base_data_set.shape[0]
            if self.comparison_data_set is None:
                comparison_deviation_frequency_percentage = "-"
                verdict = "NA"
            else:
                if type(acceptable_score) == str:
                    comparison_deviant_positions = self.comparison_data_set[parameter_column_name] != acceptable_score
                else:
                    comparison_deviant_positions = self.comparison_data_set[parameter_column_name] < acceptable_score

                comparison_deviation_frequency = self.comparison_data_set[comparison_deviant_positions][parameter_column_name].count()
                comparison_deviation_frequency_percentage = comparison_deviation_frequency/self.comparison_data_set.shape[0]
                if base_deviation_frequency_percentage<comparison_deviation_frequency_percentage:
                    verdict = "Better"
                elif base_deviation_frequency_percentage==comparison_deviation_frequency_percentage:
                    verdict = "No Change"
                else:
                    verdict = "Worse"

            parameter_data = [parameter, base_deviation_frequency_percentage, comparison_deviation_frequency_percentage, verdict]
            counter +=1
            parameter_summary_data.append(parameter_data)

        #self.printMessage(parameter_summary_data)
        try:
            summary_data_frame = pd.DataFrame(parameter_summary_data, index=parameter_class_list, columns =["Parameter Description", "Base Deviation Frequency", "Comparison Deviation Frequency","Verdict"]).sort_values(["Base Deviation Frequency"], ascending=False)
        except:
            summary_data_frame = pd.DataFrame(parameter_summary_data, index=parameter_class_list, columns =["Parameter Description", "Base Deviation Frequency", "Comparison Deviation Frequency","Verdict"]).sort(columns=["Base Deviation Frequency"], ascending=False)

        #self.printMessage(summary_data_frame)
        #Clear the canvas
        fig, ax = plt.subplots()

        x_positions = np.arange(len(summary_data_frame.index))
        width = 0.35

        base_data_list = [x*100 for x in summary_data_frame["Base Deviation Frequency"]]
        base_bar_graphs = ax.bar(x_positions, base_data_list, width, color='y')
        ax.set_xticks(x_positions+width)
        parameter_names = [self.wordWrap(x) for x in list(summary_data_frame["Parameter Description"])]
        ax.set_xticklabels(parameter_names, rotation=90)
        #Set x and y labels.
        ax.set_xlabel("Quality Parameters")
        ax.set_ylabel("Deviation Frequency Percentage\n(Lower the bar, better the performance)")
        
        user_name = MOSES.getEmpName(self.user_id)
        time_stamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")

        ax.set_title("Pareto Chart\n[Generated by OINK for %s at %s]"%(user_name, time_stamp))
        
        base_label = self.base_data_set_group.getLabel()
        reference_label = self.comparison_data_set_group.getLabel()

        if self.comparison_data_set is not None:
            comparison_data_list = [x*100 for x in summary_data_frame["Comparison Deviation Frequency"]]
            comparison_bar_graphs = ax.bar(x_positions+width, comparison_data_list, width, color='g')
            ax.legend((base_bar_graphs[0], comparison_bar_graphs[0]), (base_label, reference_label))
        
        self.plot_data_table.showDataFrame(summary_data_frame)
        plt.subplots_adjust(left=0.1, right=0.9, top=0.9, bottom=0.5)
        filename = os.path.join(os.getcwd(),"cache","Pareto_%s_vs_%s_%s.png"%(base_label.replace(" ","_"), reference_label.replace(" ","_"), time_stamp))

        plt.savefig("%s"%filename)
        self.plot_viewer.showImage(filename, int(self.plot_data_table.size().width()),int(self.plot_data_table.size().height()))
        plt.show()

        pareto_image_object = True
        return pareto_image_object
开发者ID:vinay87,项目名称:oink,代码行数:92,代码来源:TNAViewer.py


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