Exemplo n.º 1
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        Form.setMaximumSize(400, 300)
        self.label = QtWidgets.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(90, 120, 41, 21))
        self.label.setObjectName("label")
        self.lineEdit = QtWidgets.QLineEdit(Form)
        self.lineEdit.setGeometry(QtCore.QRect(140, 120, 151, 21))
        self.lineEdit.setObjectName("lineEdit")
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setGeometry(QtCore.QRect(90, 160, 41, 21))
        self.label_2.setObjectName("label_2")
        self.lineEdit_2 = QtWidgets.QLineEdit(Form)
        self.lineEdit_2.setGeometry(QtCore.QRect(140, 160, 151, 21))
        self.lineEdit_2.setObjectName("lineEdit_2")
        self.label_3 = QtWidgets.QLabel(Form)
        self.label_3.setGeometry(QtCore.QRect(40, 40, 311, 51))
        self.label_3.setText("")
        self.label_3.setPixmap(
            QtGui.QPixmap("./image/Snipaste_2020-01-03_19-24-51.png"))
        self.label_3.setObjectName("label_3")
        self.pushButton = QtWidgets.QPushButton(Form)
        self.pushButton.setGeometry(QtCore.QRect(210, 230, 88, 31))
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(Form)
        self.pushButton_2.setGeometry(QtCore.QRect(90, 230, 88, 31))
        self.pushButton_2.setObjectName("pushButton_2")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

        self.register_page = RegisterPage()

        self.backstage = Backstage()
Exemplo n.º 2
0
    def __init__(self, user_id):
        super(AlterPage, self).__init__()
        self.setWindowTitle("修改信息")
        self.user_id = user_id
        self.label_3 = QtWidgets.QLabel('手机号码', self)
        self.label_4 = QtWidgets.QLabel('邮箱地址', self)
        self.label_5 = QtWidgets.QLabel('密码', self)
        self.lineEdit_3 = QtWidgets.QLineEdit(self)
        self.lineEdit_4 = QtWidgets.QLineEdit(self)
        self.lineEdit_5 = QtWidgets.QLineEdit(self)

        self.register_button = QtWidgets.QPushButton('保存', self)
        self.layout_3 = QtWidgets.QHBoxLayout()
        self.layout_4 = QtWidgets.QHBoxLayout()
        self.layout_5 = QtWidgets.QHBoxLayout()
        self.all_layout = QtWidgets.QVBoxLayout()

        self.line_edit_init()
        self.button_init()
        self.layout_init()

        self.backstage = Backstage()
        result = self.backstage.select_user_name(self.user_id)
        print("result", result)
        if result:
            if result[0]:
                self.lineEdit_3.setPlaceholderText(
                    result[0][0]['phone_number'])
                self.lineEdit_4.setPlaceholderText(result[0][0]['email'])
                self.lineEdit_5.setPlaceholderText(result[0][0]['password'])
Exemplo n.º 3
0
    def __init__(self):
        super(RegisterPage, self).__init__()
        self.setWindowTitle("注册")
        self.user_label = QtWidgets.QLabel('用户名', self)
        self.pwd_label = QtWidgets.QLabel('密码', self)
        self.pwd_label_2 = QtWidgets.QLabel('重复密码', self)
        self.label_3 = QtWidgets.QLabel('手机号码', self)
        self.label_4 = QtWidgets.QLabel('电子邮箱', self)

        #self.label_4 = QtWidgets.QLabel('头像', self)

        self.user_lineEdit = QtWidgets.QLineEdit(self)
        self.pwd_lineEdit = QtWidgets.QLineEdit(self)
        self.pwd_lineEdit_2 = QtWidgets.QLineEdit(self)
        self.lineEdit_3 = QtWidgets.QLineEdit(self)
        self.lineEdit_4 = QtWidgets.QLineEdit(self)
        self.register_button = QtWidgets.QPushButton('注册', self)
        self.user_layout = QtWidgets.QHBoxLayout()
        self.layout_3 = QtWidgets.QHBoxLayout()
        self.layout_4 = QtWidgets.QHBoxLayout()
        self.pwd_layout = QtWidgets.QHBoxLayout()
        self.pwd_layout_2 = QtWidgets.QHBoxLayout()
        self.all_layout = QtWidgets.QVBoxLayout()

        self.line_edit_init()
        self.button_init()
        self.layout_init()

        self.backstage = Backstage()
Exemplo n.º 4
0
    def __init__(self, user_id):
        super(RecordPage, self).__init__()
        self.setWindowTitle("记账")
        self.user_id = user_id
        self.user_label = QtWidgets.QLabel('收支', self)
        self.pwd_label = QtWidgets.QLabel('收支时间', self)
        self.pwd_label_2 = QtWidgets.QLabel('收支类型', self)
        self.label_3 = QtWidgets.QLabel('收支名称', self)
        self.label_4 = QtWidgets.QLabel('收支金额', self)
        self.label_5 = QtWidgets.QLabel('备注', self)
        self.choice_list = ["收入", "支出"]

        self.combobox = QComboBox(self)
        self.combobox.addItems(self.choice_list)
        self.user_lineEdit = QtWidgets.QLineEdit(self)
        self.pwd_lineEdit = QtWidgets.QLineEdit(self)
        self.pwd_lineEdit_2 = QtWidgets.QLineEdit(self)
        self.lineEdit_3 = QtWidgets.QLineEdit(self)
        self.lineEdit_4 = QtWidgets.QLineEdit(self)

        self.register_button = QtWidgets.QPushButton('保存', self)
        self.user_layout = QtWidgets.QHBoxLayout()
        self.layout_3 = QtWidgets.QHBoxLayout()
        self.layout_4 = QtWidgets.QHBoxLayout()
        self.pwd_layout = QtWidgets.QHBoxLayout()
        self.pwd_layout_2 = QtWidgets.QHBoxLayout()
        self.layout_5 = QtWidgets.QHBoxLayout()
        self.all_layout = QtWidgets.QVBoxLayout()

        self.line_edit_init()
        self.button_init()
        self.layout_init()

        self.backstage = Backstage()
Exemplo n.º 5
0
 def sell_in_plus_1():
     backsetage = Backstage("VIP", 12, 10)
     backsetage.update_quality()
     assert backsetage.updated_item() == ("VIP", 11, 11)
Exemplo n.º 6
0
 def sell_in_equal_0():
     backsetage = Backstage("VIP", 1, 15)
     backsetage.update_quality()
     assert backsetage.updated_item() == ("VIP", 0, 0)
Exemplo n.º 7
0
 def sell_in_plus_3():
     backsetage = Backstage("VIP", 5, 15)
     backsetage.update_quality()
     assert backsetage.updated_item() == ("VIP", 4, 18)
Exemplo n.º 8
0
from backstage import Backstage


class GildedRose():
    def __init__(self, stock):
        self.stock = stock

    def getStock(self):
        return self.stock

    def actualizarStock(self):
        for item in self.stock:
            item.update_quality()


if __name__ == "__main__":

    stock = [
        AgedBrie("Aged Brie", 2, 0),
        Sulfuras("Sulfuras", 0, 80),
        Backstage("Backstage", 12, 23)
    ]

    tienda = GildedRose(stock)
    tienda.actualizarStock()
    assert tienda.getStock()[0].getQuality() == 1
    assert tienda.getStock()[1].getName() == "Sulfuras"
    assert tienda.getStock()[2].getSellIn() == 11
    assert tienda.getStock()[1].getSellIn() == 0
    assert tienda.getStock()[2].getQuality() == 24
Exemplo n.º 9
0
from backstage import Backstage
from aged_brie import AgedBrie
from sulfuras import Sulfuras

class GildedRose():


    def __init__(self, stock):
        self.stock = stock
    
    def getStock(self):
        return self.stock

    def updateStock(self, stock):
        for item in self.stock:
            item.update_quality()


if __name__ == '__main__':

    # CREATED STOCK
    stock = [AgedBrie("agedBrie", 100, 20), Backstage("backstage", 15, 10), Sulfuras("sulfuras", 10, 80)]
    store = GildedRose(stock)
    store.updateStock(stock)

    # TEST CASES
    assert 80 == store.getStock()[2].getQuality()
    assert 21 == store.getStock()[0].getQuality()
    assert 11 == store.getStock()[1].getQuality()
Exemplo n.º 10
0
    def setupUi(self, Form, User_Id):
        Form.setObjectName("Form")
        Form.resize(1051, 791)
        Form.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.user_id = User_Id
        self.widget = QtWidgets.QWidget(Form)
        self.widget.setGeometry(QtCore.QRect(0, 130, 1051, 141))
        self.widget.setStyleSheet(
            ".QWidget{background-color:rgb(244, 245, 250);}")
        self.widget.setObjectName("widget")
        self.line = QtWidgets.QFrame(self.widget)
        self.line.setGeometry(QtCore.QRect(190, 30, 691, 20))
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.line.setObjectName("line")
        self.label_5 = QtWidgets.QLabel(self.widget)
        self.label_5.setGeometry(QtCore.QRect(190, 10, 81, 21))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(14)
        self.label_5.setFont(font)
        self.label_5.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.label_5.setObjectName("label_5")
        self.dateEdit_2 = QtWidgets.QDateTimeEdit(self.widget)
        self.dateEdit_2.setGeometry(QtCore.QRect(410, 50, 110, 22))
        self.dateEdit_2.setObjectName("dateEdit_2")
        self.dateEdit_2.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.dateEdit_2.setDate(QDate.currentDate())
        self.label_2 = QtWidgets.QLabel(self.widget)
        self.label_2.setGeometry(QtCore.QRect(389, 50, 16, 21))
        self.label_2.setObjectName("label_2")
        self.label_2.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.dateEdit = QtWidgets.QDateTimeEdit(self.widget)
        self.dateEdit.setGeometry(QtCore.QRect(270, 50, 110, 22))
        self.dateEdit.setObjectName("dateEdit")
        self.dateEdit.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.dateEdit.setDate(QDate.currentDate())
        self.label = QtWidgets.QLabel(self.widget)
        self.label.setGeometry(QtCore.QRect(210, 50, 51, 21))
        self.label.setObjectName("label")
        self.label.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.label_4 = QtWidgets.QLabel(self.widget)
        self.label_4.setGeometry(QtCore.QRect(210, 80, 41, 21))
        self.label_4.setObjectName("label_4")
        self.label_4.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.groupBox = QtWidgets.QGroupBox(self.widget)
        self.groupBox.setGeometry(QtCore.QRect(270, 80, 421, 21))
        self.groupBox.setTitle("")
        self.groupBox.setObjectName("groupBox")
        self.groupBox.setStyleSheet(
            ".QGroupBox{color:black;background-color:rgb(244, 245, 250);}")
        self.radioButton_5 = QtWidgets.QRadioButton(self.groupBox)
        self.radioButton_5.setGeometry(QtCore.QRect(0, 0, 61, 21))
        self.radioButton_5.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.radioButton_5.setChecked(True)
        self.radioButton_5.setObjectName("radioButton_5")
        self.radioButton_5.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.radioButton_6 = QtWidgets.QRadioButton(self.groupBox)
        self.radioButton_6.setGeometry(QtCore.QRect(60, 0, 61, 21))
        self.radioButton_6.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.radioButton_6.setObjectName("radioButton_6")
        self.radioButton_6.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.radioButton_7 = QtWidgets.QRadioButton(self.groupBox)
        self.radioButton_7.setGeometry(QtCore.QRect(120, 0, 61, 21))
        self.radioButton_7.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.radioButton_7.setObjectName("radioButton_7")
        self.radioButton_7.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.radioButton_8 = QtWidgets.QRadioButton(self.groupBox)
        self.radioButton_8.setGeometry(QtCore.QRect(180, 0, 61, 21))
        self.radioButton_8.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.radioButton_8.setObjectName("radioButton_8")
        self.radioButton_8.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.radioButton_9 = QtWidgets.QRadioButton(self.groupBox)
        self.radioButton_9.setGeometry(QtCore.QRect(240, 0, 61, 21))
        self.radioButton_9.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.radioButton_9.setObjectName("radioButton_9")
        self.radioButton_9.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.radioButton_10 = QtWidgets.QRadioButton(self.groupBox)
        self.radioButton_10.setGeometry(QtCore.QRect(300, 0, 61, 21))
        self.radioButton_10.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.radioButton_10.setObjectName("radioButton_10")
        self.radioButton_10.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.radioButton_11 = QtWidgets.QRadioButton(self.groupBox)
        self.radioButton_11.setGeometry(QtCore.QRect(360, 0, 61, 21))
        self.radioButton_11.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.radioButton_11.setObjectName("radioButton_11")
        self.radioButton_11.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.label_9 = QtWidgets.QLabel(self.widget)
        self.label_9.setGeometry(QtCore.QRect(770, 10, 41, 21))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(12)
        self.label_9.setFont(font)
        self.label_9.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.label_9.setObjectName("label_9")
        self.label_10 = QtWidgets.QLabel(self.widget)
        self.label_10.setGeometry(QtCore.QRect(810, 10, 71, 21))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(12)
        self.label_10.setFont(font)
        self.label_10.setText(User_Id)
        self.label_10.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.label_10.setObjectName("label_10")
        self.label_11 = QtWidgets.QLabel(self.widget)
        self.label_11.setGeometry(QtCore.QRect(210, 110, 61, 21))
        self.label_11.setObjectName("label_11")
        self.label_11.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.lineEdit = QtWidgets.QLineEdit(self.widget)
        self.lineEdit.setGeometry(QtCore.QRect(270, 110, 351, 21))
        self.lineEdit.setObjectName("lineEdit")
        self.lineEdit.setStyleSheet(
            "color:black;background-color:rgb(244, 245, 250);")
        self.lineEdit_2 = QtWidgets.QLineEdit(self.widget)
        self.lineEdit_2.setGeometry(QtCore.QRect(690, 110, 120, 21))
        self.lineEdit_2.setObjectName("lineEdit_2")
        self.pushButton_6 = QtWidgets.QPushButton(self.widget)
        self.pushButton_6.setGeometry(QtCore.QRect(640, 110, 41, 21))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(10)
        self.pushButton_6.setFont(font)
        self.pushButton_6.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_6.setStyleSheet(
            ".QPushButton {color: rgb(255, 255, 255); background-color: rgb(0, 170, 238)}"
        )
        self.pushButton_6.setAutoExclusive(False)
        self.pushButton_6.setAutoDefault(False)
        self.pushButton_6.setDefault(False)
        self.pushButton_6.setFlat(False)
        self.pushButton_6.setObjectName("pushButton_6")
        self.pushButton_7 = QtWidgets.QPushButton(self.widget)
        self.pushButton_7.setGeometry(QtCore.QRect(690, 80, 41, 21))
        self.pushButton_7.setFont(font)
        self.pushButton_7.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_7.setStyleSheet(
            ".QPushButton {color: rgb(255, 255, 255); background-color: rgb(0, 170, 238)}"
        )
        self.pushButton_7.setAutoExclusive(False)
        self.pushButton_7.setAutoDefault(False)
        self.pushButton_7.setDefault(False)
        self.pushButton_7.setFlat(False)
        self.pushButton_7.setObjectName("pushButton_7")
        self.pushButton_8 = QtWidgets.QPushButton(self.widget)
        self.pushButton_8.setGeometry(QtCore.QRect(530, 50, 41, 21))
        self.pushButton_8.setFont(font)
        self.pushButton_8.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_8.setStyleSheet(
            ".QPushButton {color: rgb(255, 255, 255); background-color: rgb(0, 170, 238)}"
        )
        self.pushButton_8.setAutoExclusive(False)
        self.pushButton_8.setAutoDefault(False)
        self.pushButton_8.setDefault(False)
        self.pushButton_8.setFlat(False)
        self.pushButton_8.setObjectName("pushButton_7")
        self.pushButton_9 = QtWidgets.QPushButton(self.widget)
        self.pushButton_9.setGeometry(QtCore.QRect(820, 110, 41, 21))
        self.pushButton_9.setFont(font)
        self.pushButton_9.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_9.setStyleSheet(
            ".QPushButton {color: rgb(255, 255, 255); background-color: rgb(0, 170, 238)}"
        )
        self.pushButton_9.setAutoExclusive(False)
        self.pushButton_9.setAutoDefault(False)
        self.pushButton_9.setDefault(False)
        self.pushButton_9.setFlat(False)
        self.pushButton_9.setObjectName("pushButton_9")
        self.widget_2 = QtWidgets.QWidget(Form)
        self.widget_2.setGeometry(QtCore.QRect(0, 270, 1051, 521))
        self.widget_2.setStyleSheet(
            ".QWidget{background-color:rgb(255, 255, 255);}")
        self.widget_2.setObjectName("widget_2")
        self.tableView = QtWidgets.QTableView(self.widget_2)
        self.widget_3 = QtWidgets.QWidget(Form)
        self.widget_3.setGeometry(QtCore.QRect(0, 130, 531, 291))
        self.widget_3.setStyleSheet(
            ".QWidget{background-color:rgb(255, 255, 255);}")
        self.widget_3.setObjectName("widget_3")
        self.widget_3.setVisible(False)
        self.widget_5 = QtWidgets.QWidget(Form)
        self.widget_5.setGeometry(QtCore.QRect(530, 130, 521, 291))
        self.widget_5.setStyleSheet(
            ".QWidget{background-color:rgb(255, 255, 255);}")
        self.widget_5.setObjectName("widget_5")
        self.widget_5.setVisible(False)
        self.widget_4 = QtWidgets.QWidget(Form)
        self.widget_4.setGeometry(QtCore.QRect(0, 130, 1051, 661))
        self.widget_4.setStyleSheet(
            ".QWidget{background-color:rgb(255, 255, 255);}")
        self.widget_4.setObjectName("widget_4")
        self.v_layout_2 = QtWidgets.QVBoxLayout()
        self.widget_4.setLayout(self.v_layout_2)
        self.widget_4.setVisible(False)
        self.tableView.setGeometry(QtCore.QRect(190, 0, 701, 521))
        self.tableView.setObjectName("tableView")
        self.tableView.horizontalHeader().setSectionResizeMode(
            QHeaderView.Stretch)
        self.groupBox_3 = QtWidgets.QGroupBox(Form)
        self.groupBox_3.setGeometry(QtCore.QRect(0, 0, 1051, 131))
        self.groupBox_3.setTitle("")
        self.groupBox_3.setObjectName("groupBox_3")
        self.pushButton_3 = QtWidgets.QPushButton(self.groupBox_3)
        self.pushButton_3.setGeometry(QtCore.QRect(100, 0, 171, 131))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(16)
        self.pushButton_3.setFont(font)
        self.pushButton_3.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_3.setStyleSheet("QPushButton {\n"
                                        "background-color:rgb(25, 35, 45);\n"
                                        "color:white;\n"
                                        "}\n"
                                        "\n"
                                        "QPushButton:hover {\n"
                                        "padding-top:10px;\n"
                                        "font-size:25px;\n"
                                        "Width:30px;\n"
                                        "}\n"
                                        "\n"
                                        "QPushButton:pressed {\n"
                                        "}")
        self.pushButton_3.setObjectName("pushButton_3")
        self.label_6 = QtWidgets.QLabel(self.groupBox_3)
        self.label_6.setGeometry(QtCore.QRect(440, 0, 171, 131))
        self.label_6.setStyleSheet(
            ".QLabel{background-color: rgb(25, 35, 45);\n"
            "\n"
            "font-size:100px;}")
        self.label_6.setText("")
        self.label_6.setObjectName("label_6")
        self.pushButton_4 = QtWidgets.QPushButton(self.groupBox_3)
        self.pushButton_4.setGeometry(QtCore.QRect(490, 20, 101, 101))
        self.pushButton_4.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_4.setStyleSheet(
            "QPushButton {\n"
            "\n"
            "font-size:45px;\n"
            "border-radius:50px;\n"
            "\n"
            "border-image: url(D:/Python/Python3.6.6/MyPythonScripts/PersonalFinancialManage/image/T11K0yXipdXXXXXXXX.jpg);}\n"
            "\n"
            "QPushButton:hover {\n"
            "font-size:40px;\n"
            "border-radius:45px;\n"
            "border-image: url(D:/Python/Python3.6.6/MyPythonScripts/PersonalFinancialManage/image/T11K0yXipdXXXXXXXX.jpg);\n"
            "}\n"
            "QPushButton:pressed {\n"
            "font-size:70px;\n"
            "border-radius:75px;\n"
            "border-width:3;\n"
            "border-color:orange;\n"
            "border-style:solid;;\n"
            "background-color:cyan;\n"
            "}")
        self.pushButton_4.setText("")
        self.pushButton_4.setIconSize(QtCore.QSize(96, 96))
        self.pushButton_4.setAutoDefault(False)
        self.pushButton_4.setObjectName("pushButton_4")
        self.pushButton = QtWidgets.QPushButton(self.groupBox_3)
        self.pushButton.setGeometry(QtCore.QRect(270, 0, 171, 131))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(16)
        self.pushButton.setFont(font)
        self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.pushButton.setStyleSheet("QPushButton {\n"
                                      "background-color:rgb(25, 35, 45);\n"
                                      "color:white;\n"
                                      "}\n"
                                      "\n"
                                      "QPushButton:hover {\n"
                                      "padding-top:10px;\n"
                                      "font-size:25px;\n"
                                      "Width:30px;\n"
                                      "}\n"
                                      "\n"
                                      "QPushButton:pressed {\n"
                                      "}")
        self.pushButton.setObjectName("pushButton")
        self.label_7 = QtWidgets.QLabel(self.groupBox_3)
        self.label_7.setGeometry(QtCore.QRect(0, 0, 101, 131))
        self.label_7.setStyleSheet(
            ".QLabel{background-color: rgb(25, 35, 45);\n"
            "\n"
            "font-size:100px;}")
        self.label_7.setText("")
        self.label_7.setObjectName("label_7")
        self.pushButton_2 = QtWidgets.QPushButton(self.groupBox_3)
        self.pushButton_2.setGeometry(QtCore.QRect(610, 0, 171, 131))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(16)
        self.pushButton_2.setFont(font)
        self.pushButton_2.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_2.setStyleSheet("QPushButton {\n"
                                        "background-color:rgb(25, 35, 45);\n"
                                        "color:white;\n"
                                        "}\n"
                                        "\n"
                                        "QPushButton:hover {\n"
                                        "padding-top:10px;\n"
                                        "font-size:25px;\n"
                                        "Width:30px;\n"
                                        "}\n"
                                        "\n"
                                        "QPushButton:pressed {\n"
                                        "}")
        self.pushButton_2.setObjectName("pushButton_2")
        self.pushButton_5 = QtWidgets.QPushButton(self.groupBox_3)
        self.pushButton_5.setGeometry(QtCore.QRect(780, 0, 171, 131))
        font = QtGui.QFont()
        font.setFamily("Adobe Arabic")
        font.setPointSize(16)
        self.pushButton_5.setFont(font)
        self.pushButton_5.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_5.setStyleSheet("QPushButton {\n"
                                        "background-color:rgb(25, 35, 45);\n"
                                        "color:white;\n"
                                        "}\n"
                                        "\n"
                                        "QPushButton:hover {\n"
                                        "padding-top:10px;\n"
                                        "font-size:25px;\n"
                                        "Width:30px;\n"
                                        "}\n"
                                        "\n"
                                        "QPushButton:pressed {\n"
                                        "}")
        self.pushButton_5.setObjectName("pushButton_5")

        self.label_8 = QtWidgets.QLabel(self.groupBox_3)
        self.label_8.setGeometry(QtCore.QRect(950, 0, 101, 131))
        self.label_8.setStyleSheet(
            ".QLabel{background-color: rgb(25, 35, 45);\n"
            "\n"
            "font-size:100px;}")
        self.label_8.setText("")
        self.label_8.setObjectName("label_8")
        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
        self.record_page = RecordPage(User_Id)
        self.alter_page = AlterPage(User_Id)
        self.pushButton_2.clicked.connect(self.check_static_func)
        self.pushButton.clicked.connect(self.check_log_func)
        self.pushButton_3.clicked.connect(self.check_record_func)
        self.pushButton_4.clicked.connect(self.check_alter_func)
        self.pushButton_8.clicked.connect(self.check_time_func)
        self.pushButton_7.clicked.connect(self.check_type_func)
        self.pushButton_6.clicked.connect(self.check_keyword_func)
        self.pushButton_9.clicked.connect(self.check_del_func)
        self.pushButton_5.clicked.connect(self.check_export_func)

        self.backstage = Backstage()
        self.results = self.backstage.select_user_name(User_Id)
        self.label_10.setText(self.results[0][0]["user_id"])
        self.results = self.backstage.select_all_info(User_Id)
        self.table_change()
Exemplo n.º 11
0
class GildedRose(object):
    def __init__(self, items):
        self.items = items

    def update_quality(self):
        for day in range(1, 32):
            print("-------------- day ", day, "--------------")
            for item in self.items:
                print(item)
                item.update_item()

    def updated_items(self):
        return self.items


if __name__ == "__main__":
    stock = GildedRose([
        RegularItem("+ 5 Dexterity Vest", 10, 20),
        AgedBrie("Aged Brie", 2, 0),
        RegularItem("Elixir of the Mongoose", 5, 7),
        Sulfuras("Sulfuras, Hand of Ragnaros", 0, 80),
        Sulfuras("Sulfuras, Hand of Ragnaros", 0, 80),
        Backstage("Backstage passes to a TAFKAL80ETC concert", 15, 20),
        Backstage("Backstage passes to a TAFKAL80ETC concert", 10, 49),
        Backstage("Backstage passes to a TAFKAL80ETC concert", 5, 49),
        Conjured("Conjured Mana Cake", 3, 6)
    ])

    stock.update_quality()
Exemplo n.º 12
0
from agedBrie import AgedBrie
from backstage import Backstage
from sulfuras import Sulfuras


class GildedRose():


    def __init__(self, stock):
        self.stock = stock


    def getStock(self):
        return self.stock


    def update_stock(self):
        for item in self.stock:
            item.update_quality()


if __name__ == '__main__':

    # test case 1
    stock = [Sulfuras('sulfuras', 10, 80), AgedBrie('agedBrie', 3, 4), Backstage('backstage', 5, 25)]
    tienda = GildedRose(stock)
    tienda.update_stock()
    assert tienda.getStock()[0].getQuality() == 80
    assert tienda.getStock()[0].getName() == 'sulfuras'
    assert tienda.getStock()[0].getSellIn() == 10
Exemplo n.º 13
0
class GildedRose():

    def __init__(self, stock):
        self.stock = stock

    
    def getStock(self):
        return self.stock
    

    def updateStock(self):
        for item in self.stock:
            item.update_quality()




if __name__ == "__main__":
    

    # TEST CASES #

    stock = [Sulfuras('sulfuras', 10, 80), AgedBrie('agedBrie', 3, 4), Backstage('backstage', 5, 25), ConjuredItem("conjured", -1, 10)]
    tienda = GildedRose(stock)
    tienda.updateStock()

    assert tienda.getStock()[0].getQuality() == 80
    assert tienda.getStock()[0].getName() == "sulfuras"
    assert tienda.getStock()[0].getSellIn() == 10
    assert tienda.getStock()[3].getQuality() == 6
    assert tienda.getStock()[3].getSellIn() == -2