Giter Site home page Giter Site logo

Comments (8)

HenriWahl avatar HenriWahl commented on June 12, 2024 1

@jr-timme 👍 yes, done now in latest commit. Binaries shall be available soon. Thanks!

from nagstamon.

HenriWahl avatar HenriWahl commented on June 12, 2024

@fermino well, Nagstamon here is only interested in the major version. The minor and bugfix versions are only catched there from the standard QT version string.

So it would be enough to grab just the major version, via something like

QT_VERSION_MAJOR = int(QT_VERSION_STR.split('.')[0])

Regarding a version selection variable I thing we should go the Qt6 way. The used variable already comes with Qt and it would make things more complex to use such a switch.

from nagstamon.

WoutResseler avatar WoutResseler commented on June 12, 2024

Had the exact same issue, @HenriWahl 's solution does the trick for me for now.

from nagstamon.

jr-timme avatar jr-timme commented on June 12, 2024

I also ran into this Problem and am currently running Nagstamon with the change mentioned by @HenriWahl :

diff --git a/Nagstamon/QUI/qt.py b/Nagstamon/QUI/qt.py
index 3bc50c5b..50fb0886 100644
--- a/Nagstamon/QUI/qt.py
+++ b/Nagstamon/QUI/qt.py
@@ -28,7 +28,7 @@ try:
     from PyQt6.QtCore import PYQT_VERSION_STR as QT_VERSION_STR
 
     # get int-ed version parts
-    QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_BUGFIX = [int(x) for x in QT_VERSION_STR.split('.')]
+    QT_VERSION_MAJOR = int(QT_VERSION_STR.split('.')[0])
     # for later decision which differences have to be considered
     QT_FLAVOR = 'PyQt6'
 except ImportError:

I haven't found any problems yet.

So if there is no reason to include the Minor and Bugfix versions this could be merged?

from nagstamon.

HenriWahl avatar HenriWahl commented on June 12, 2024

I fixed it in latest testing release 3.15-240417 - can you please try it?

from nagstamon.

jr-timme avatar jr-timme commented on June 12, 2024

I think one of the square brackets should be moved further back as we want to limit the output of the split function to the first two elements and not the output of the list comprehension?

>>> from PyQt6.QtCore import PYQT_VERSION_STR as QT_VERSION_STR

>>> [int(x) for x in QT_VERSION_STR.split('.')][0:2]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <listcomp>
ValueError: invalid literal for int() with base 10: 'dev2404081550'

>>> [int(x) for x in QT_VERSION_STR.split('.')[0:2]]
[6, 7]

or did I misunderstand the intent of the change?

I'm not sure if the Version Number always is the way it is now but if it is, we could also keep the Patch version if we limit the array to the first 3 elements:

>>> QT_VERSION_STR.split('.')
['6', '7', '0', 'dev2404081550']
>>> [int(x) for x in QT_VERSION_STR.split('.')[0:3]]
[6, 7, 0]

edit: that also seems to be the workaround the AUR nagstamon-git package maintainer chose:

+  sed -i Nagstamon/QUI/qt.py -e "s/QT_VERSION_STR.split('.')/QT_VERSION_STR.split('.')[0:3]/"

https://aur.archlinux.org/cgit/aur.git/commit/?h=nagstamon-git&id=654ecd9de51e2ab0213bb39d2b1e1cbe226ac397

from nagstamon.

HenriWahl avatar HenriWahl commented on June 12, 2024

@jr-timme Nagstamon only needs the major and the minor version part, so it is ok to ignore the bugfix level.

from nagstamon.

jr-timme avatar jr-timme commented on June 12, 2024

Ok, so then only the square bracket should be moved further back to prevent the list comprehension from still trying to cast dev2404081550 into an integer

from nagstamon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.