diff --git a/.flake8 b/.flake8 index 276bd6d..5041c35 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,8 @@ [flake8] max-line-length = 120 exclude = src/pyqulator/ui.py + inline-quotes = " + +application-import-names = ui +import-order-style = google diff --git a/README.md b/README.md index db246c2..9ea04e0 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,8 @@ pyqulator *Unit converter* ![Screenshot](https://raw.githubusercontent.com/limafresh/pyqulator/main/screenshots/screenshot4.png) + +## Flake8 +``` +pip install flake8 flake8-quotes flake8-import-order flake8-builtins +``` diff --git a/pyproject.toml b/pyproject.toml index 5fcda42..2b57484 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyqulator" -version = "1.4.3" +version = "1.5.0" dependencies = [ "PyQt6>=6.4.2", "sympy>=1.13.3", diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index aaa6df1..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -PyQt6>=6.4.2 -sympy>=1.13.3 -pyqt6-tools -flake8 -flake8-quotes diff --git a/src/pyqulator/main.py b/src/pyqulator/main.py index 41fde39..b6dbe6f 100644 --- a/src/pyqulator/main.py +++ b/src/pyqulator/main.py @@ -1,10 +1,12 @@ +from os.path import dirname, join import sys -from os.path import join, dirname -from sympy import sympify, Rational, log, sin, cos, tan, exp, pi, E, sqrt -from sympy.physics import units -from PyQt6.QtWidgets import QApplication, QMainWindow, QMessageBox, QFileDialog -from PyQt6.QtCore import QLocale, QTranslator, QSettings, Qt + +from PyQt6.QtCore import QLocale, QSettings, Qt, QTranslator from PyQt6.QtGui import QActionGroup, QIcon +from PyQt6.QtWidgets import QApplication, QFileDialog, QMainWindow, QMessageBox +from sympy import cos, E, exp, log, pi, Rational, sin, sqrt, sympify, tan +from sympy.physics import units + from .ui import Ui_MainWindow @@ -454,6 +456,8 @@ def line_result_paste(self): if char.isdigit() or char in ".": filtered_text += char self.current_line_result.setText(filtered_text) + if self.current_line_result.text() == "": + self.clear_line_result() def line_top(self): while self.ui.horizontalLayout.count(): @@ -480,13 +484,14 @@ def line_down(self): # Show windows with info about program and Qt def show_about_program(self): self.about_msg = QMessageBox() - self.about_msg.setWindowTitle("About pyqulator") + self.about_msg.setWindowTitle("About Pyqulator") msg_text = """ - pyqulator is a calculator written - in Python and PyQt 6. - Uses library: sympy. - Licensed under GNU GPL v3. - (c) limafresh, 2024 +

Pyqulator is a calculator written
+ in Python and PyQt 6.
+ Uses library: sympy.
+ Licensed under GNU GPL v3.
+ (c) limafresh, 2024

+

Visit repository

""" self.about_msg.setText(msg_text) icon = QIcon.fromTheme(u"accessories-calculator")