gammu / wammu

Wammu
https://wammu.eu/wammu/
GNU General Public License v3.0
64 stars 28 forks source link

Python 3 / wxPython 4 Support #78

Open swt2c opened 5 years ago

swt2c commented 5 years ago

Now that wxPython 4 is out (with Python 3 support) it would be great if wammu supported wxPython 4 and Python 3.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/69212196-python-3-wxpython-4-support?utm_campaign=plugin&utm_content=tracker%2F253406&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F253406&utm_medium=issues&utm_source=github).
nijel commented 5 years ago

Patches are welcome, it's unlikely that I will find time for that.

swt2c commented 5 years ago

I may take a stab at it. I'm assuming you would want to retain Python 2 / wxPython 3.x support as well?

nijel commented 5 years ago

I would not mind dropping Python 2 support

sergiomb2 commented 5 years ago

Hello , @swt2c , now with Fedora dropping python 2 [1] and [2]

[1] https://fedoraproject.org/wiki/Changes/RetirePython2

[2] https://bugzilla.redhat.com/show_bug.cgi?id=1737869

swt2c commented 5 years ago

Yes, @sergiomb2 that was my motivation in the first place. However, I'm not very motivated as I don't actually use wammu.

sergiomb2 commented 5 years ago

ya , even https://github.com/gammu/wammu/blob/master/setup.py is not python 3 compatible ... I don't use this software since 2 or 4 years ago with usb pen mobile network 3G

swt2c commented 5 years ago

Maybe just retire it from Fedora?

nijel commented 5 years ago

The same issue is on Debian, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=938807

sergiomb2 commented 5 years ago

Let me know if any progress on Debian package I will follow it on Fedora .

Thanks

nijel commented 5 years ago

Unless somebody steps up to implement needed changes, the package will be removed.

lgbaldoni commented 2 years ago

How does https://github.com/gammu/wammu/commit/33faf642640918256b2bca6cf56db681e60f578d relate to this?

nijel commented 2 years ago

There is no relationship. It is just a bump of a GitHub action...

kamikaze-kun commented 1 year ago

Hello. I am trying to make Wammu working on Python 3 during spare time at work. It's Windows 7 PC with limited (because security) internet, and I upload many changes at once later at home. I worked with Delphi for several years and Python is new for me but it is very interesting. Hopefully there are a lot of documentation and advice over the web.

Next thing to fix: SMS and Messages export. These are the main things why I use Wammu. Still no success in loading locale files…

Please check my Wammu fork. Looking forward to any help.

Jancs-E commented 1 year ago

Hi! Any news regarding use of Wammu on Linux having Python 3.9? I went around one issue, but wammu expects wxPython being installed under 2.7.

ppisa commented 9 months ago

I have successfully tested fork https://github.com/kamikaze-kun/wammu. The branch python3 works for me with some minor corrections.

--- Main.py.orig        2024-01-14 10:46:20.917228159 +0100
+++ Main.py     2024-01-14 10:47:56.017224259 +0100
@@ -975,7 +975,7 @@

     def OnProgress(self, evt):
         if hasattr(self, 'progress'):
-            if not self.progress.Update(evt.progress):
+            if not self.progress.Update(round(evt.progress)):
                 try:
                     evt.cancel()
                 except:

to resolve

  File "/opt/gammu/lib/python3.11/dist-packages/wammu-0.44-py3.11.egg/Wammu/Main.py", line 978, in OnProgress
    if not self.progress.Update(evt.progress):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Exception: TypeError: ProgressDialog.Update(): argument 1 has unexpected type 'float'

and I have some problems with resources/images lookup solved by

--- Paths.py.orig       2024-01-14 02:58:13.430861085 +0100
+++ Paths.py    2024-01-14 01:56:29.882999398 +0100
@@ -36,6 +37,8 @@
     os.path.join(os.path.dirname(__file__).replace('lib/python2.7/dist-packages/Wammu', ''), 'share', 'Wammu'),
      # Local directory
     os.path.join(os.path.dirname(__file__), '..'),
+    os.path.join(os.path.dirname(__file__), '../share/Wammu'),
+    #os.path.join(os.path.dirname(__file__), '/opt/gammu/lib/python3.11/dist-packages/wammu-0.44-py3.11.egg/share'),
 ]

 def CheckImagesPath(path):

My test are on Debian 12.4 (Bookworm, actual stable). The gammu, python_gammu and wammu are build into /opt/gammu prefix and hacked and symlinked to /usr/local/bin, /usr/local/lib and /usr/local/lib/python3.11/dist-packages.