-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dacde13
Showing
12 changed files
with
817 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
*.local | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache/ | ||
.hypothesis/ | ||
coverage.xml | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# virtualenv | ||
venv/ | ||
.venv/ | ||
ENV/ | ||
|
||
# pytest | ||
.pytest_cache/ | ||
|
||
# IDE | ||
.idea/ | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# Allure results | ||
allure-results/ | ||
|
||
# Documentation | ||
_build/ | ||
reference/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
CODE = src | ||
TESTS = tests | ||
|
||
ALL = $(CODE) $(TESTS) | ||
|
||
VENV ?= .venv | ||
|
||
venv: | ||
python3 -m venv $(VENV) | ||
$(VENV)/bin/python -m pip install --upgrade pip | ||
$(VENV)/bin/python -m pip install poetry | ||
$(VENV)/bin/poetry install | ||
|
||
test: | ||
$(VENV)/bin/pytest -v tests | ||
|
||
lint: | ||
$(VENV)/bin/flake8 --jobs 4 --statistics --show-source $(ALL) | ||
$(VENV)/bin/pylint --jobs 4 --rcfile=setup.cfg $(CODE) | ||
$(VENV)/bin/black --skip-string-normalization --check $(ALL) | ||
$(VENV)/bin/mypy $(CODE) | ||
|
||
format: | ||
$(VENV)/bin/isort --apply --recursive $(ALL) | ||
$(VENV)/bin/black --skip-string-normalization $(ALL) | ||
$(VENV)/bin/autoflake --recursive --in-place --remove-all-unused-imports $(ALL) | ||
$(VENV)/bin/unify --in-place --recursive $(ALL) | ||
|
||
ci: lint test |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[tool.poetry] | ||
name = "gui" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Your Name <[email protected]>"] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
pylint = "^2.4.4" | ||
mypy = "^0.761" | ||
pydantic = "^1.4" | ||
pyqt5 = "^5.15.0" | ||
|
||
[tool.poetry.dev-dependencies] | ||
|
||
[build-system] | ||
requires = ["poetry>=0.12"] | ||
build-backend = "poetry.masonry.api" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from PyQt5 import QtWidgets, QtCore | ||
from PyQt5.QtCore import Qt | ||
from PyQt5.QtWidgets import QLineEdit, QPushButton, QVBoxLayout, QHBoxLayout, QWidget, QMainWindow | ||
|
||
from src.main_window import MainWindow | ||
from ui.auth_form import Ui_AuthorizationForm | ||
|
||
|
||
class LoginForm(Ui_AuthorizationForm, QMainWindow): | ||
def __init__(self): | ||
super().__init__(None, Qt.WindowCloseButtonHint) | ||
self.setupUi(self) | ||
|
||
self.confirmButton.clicked.connect(self.auth) | ||
self.cancelButton.clicked.connect(lambda: self.close()) | ||
|
||
self.mainWindow = MainWindow(self) | ||
|
||
def init(self): | ||
self.show() | ||
|
||
def auth(self): | ||
self.close() | ||
self.mainWindow.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from sys import argv | ||
|
||
from PyQt5.QtWidgets import QApplication | ||
|
||
from src.login_window import LoginForm | ||
from src.main_window import MainWindow | ||
|
||
|
||
class Main: | ||
def __init__(self): | ||
self.loginForm = LoginForm() | ||
|
||
def launch(self): | ||
self.loginForm.init() | ||
|
||
|
||
if __name__ == '__main__': | ||
app = QApplication(argv) | ||
main = Main() | ||
main.launch() | ||
app.exec_() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from PyQt5 import QtWidgets, QtCore | ||
from PyQt5.QtCore import Qt | ||
from PyQt5.QtWidgets import QLineEdit, QPushButton, QVBoxLayout, QHBoxLayout, QWidget, QMainWindow | ||
|
||
from ui.main import Ui_MainWindow | ||
|
||
|
||
class MainWindow(Ui_MainWindow, QMainWindow): | ||
def __init__(self, parent): | ||
super().__init__(parent, Qt.WindowCloseButtonHint | Qt.WindowMinimizeButtonHint) | ||
self.setupUi(self) | ||
|
||
def init(self): | ||
self.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Form implementation generated from reading ui file 'auth_form.ui' | ||
# | ||
# Created by: PyQt5 UI code generator 5.15.0 | ||
# | ||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is | ||
# run again. Do not edit this file unless you know what you are doing. | ||
|
||
|
||
from PyQt5 import QtCore, QtGui, QtWidgets | ||
|
||
|
||
class Ui_AuthorizationForm(object): | ||
def setupUi(self, AuthorizationForm): | ||
AuthorizationForm.setObjectName("AuthorizationForm") | ||
AuthorizationForm.resize(231, 109) | ||
self.loginWidget = QtWidgets.QWidget(AuthorizationForm) | ||
self.loginWidget.setObjectName("loginWidget") | ||
self.gridLayout = QtWidgets.QGridLayout(self.loginWidget) | ||
self.gridLayout.setContentsMargins(10, 10, 10, 10) | ||
self.gridLayout.setHorizontalSpacing(10) | ||
self.gridLayout.setVerticalSpacing(6) | ||
self.gridLayout.setObjectName("gridLayout") | ||
self.login = QtWidgets.QLineEdit(self.loginWidget) | ||
self.login.setText("") | ||
self.login.setObjectName("login") | ||
self.gridLayout.addWidget(self.login, 0, 0, 1, 2) | ||
self.confirmButton = QtWidgets.QPushButton(self.loginWidget) | ||
self.confirmButton.setAutoDefault(False) | ||
self.confirmButton.setDefault(False) | ||
self.confirmButton.setObjectName("confirmButton") | ||
self.gridLayout.addWidget(self.confirmButton, 1, 1, 1, 1) | ||
self.cancelButton = QtWidgets.QPushButton(self.loginWidget) | ||
self.cancelButton.setObjectName("cancelButton") | ||
self.gridLayout.addWidget(self.cancelButton, 1, 0, 1, 1) | ||
AuthorizationForm.setCentralWidget(self.loginWidget) | ||
|
||
self.retranslateUi(AuthorizationForm) | ||
QtCore.QMetaObject.connectSlotsByName(AuthorizationForm) | ||
|
||
def retranslateUi(self, AuthorizationForm): | ||
_translate = QtCore.QCoreApplication.translate | ||
AuthorizationForm.setWindowTitle(_translate("AuthorizationForm", "Вход")) | ||
self.login.setPlaceholderText(_translate("AuthorizationForm", "Логин")) | ||
self.confirmButton.setText(_translate("AuthorizationForm", "Войти")) | ||
self.cancelButton.setText(_translate("AuthorizationForm", "Отменить")) | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
app = QtWidgets.QApplication(sys.argv) | ||
AuthorizationForm = QtWidgets.QMainWindow() | ||
ui = Ui_AuthorizationForm() | ||
ui.setupUi(AuthorizationForm) | ||
AuthorizationForm.show() | ||
sys.exit(app.exec_()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>AuthorizationForm</class> | ||
<widget class="QMainWindow" name="AuthorizationForm"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>231</width> | ||
<height>109</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>MainWindow</string> | ||
</property> | ||
<widget class="QWidget" name="loginWidget"> | ||
<layout class="QGridLayout" name="gridLayout"> | ||
<property name="leftMargin"> | ||
<number>10</number> | ||
</property> | ||
<property name="topMargin"> | ||
<number>10</number> | ||
</property> | ||
<property name="rightMargin"> | ||
<number>10</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>10</number> | ||
</property> | ||
<property name="horizontalSpacing"> | ||
<number>10</number> | ||
</property> | ||
<property name="verticalSpacing"> | ||
<number>6</number> | ||
</property> | ||
<item row="0" column="0" colspan="2"> | ||
<widget class="QLineEdit" name="login"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="placeholderText"> | ||
<string>Логин</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="1"> | ||
<widget class="QPushButton" name="confirmButton"> | ||
<property name="text"> | ||
<string>Войти</string> | ||
</property> | ||
<property name="autoDefault"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="default"> | ||
<bool>false</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QPushButton" name="cancelButton"> | ||
<property name="text"> | ||
<string>Отменить</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.