Skip to content

Commit

Permalink
Added a link to the repository in the About window, fixed a bug that …
Browse files Browse the repository at this point in the history
…if you insert empty text, the field will be without zero, improved formatting using flake8
  • Loading branch information
limafresh committed Oct 21, 2024
1 parent 5c532ee commit b660204
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[flake8]
max-line-length = 120
exclude = src/pyqulator/ui.py

inline-quotes = "
application-import-names = ui
import-order-style = google
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

27 changes: 16 additions & 11 deletions src/pyqulator/main.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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():
Expand All @@ -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
<p>Pyqulator is a calculator written<br>
in Python and PyQt 6.<br>
Uses library: sympy.<br>
Licensed under GNU GPL v3.<br>
(c) limafresh, 2024</p>
<p><a href="https://github.com/limafresh/pyqulator">Visit repository</a></p>
"""
self.about_msg.setText(msg_text)
icon = QIcon.fromTheme(u"accessories-calculator")
Expand Down

0 comments on commit b660204

Please sign in to comment.