Page 1 of 1

turboprint-startmonitor doesn't run

Posted: Sun Jul 11, 2021 7:42 pm
by Jiffy1111
Hi,
I am running TurboPrint 2.50-1 on 64 bit Arch and the monitor will not run.
Everything else seems to work.
I receive the following error when I try to launch it from the command line:

Code: Select all

/usr/lib/turboprint/turboprint-startmonitor
Traceback (most recent call last):
  File "/usr/lib/turboprint/appindicator/tpapplet.py", line 3, in <module>
    from gi.repository import Gtk as gtk
  File "/usr/lib/python2.7/site-packages/gi/importer.py", line 146, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/usr/lib/python2.7/site-packages/gi/overrides/__init__.py", line 118, in load_overrides
    override_mod = importlib.import_module(override_package_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/gi/overrides/Gtk.py", line 173, in <module>
    class Container(Gtk.Container, Widget):
  File "/usr/lib/python2.7/site-packages/gi/module.py", line 132, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gtk' object has no attribute 'Container'

Code: Select all

/usr/bin/python2 --version
Python 2.7.18
Since Python 2 has been end of life for awhile now, will you be upgrading to utilize python 3 in the near future?
Thank you

Re: turboprint-startmonitor doesn't run

Posted: Tue Jul 20, 2021 11:21 pm
by Jiffy1111
Hi, any news/update?
Thank you.

Re: turboprint-startmonitor doesn't run

Posted: Wed Jul 21, 2021 8:26 am
by zedonet
Hallo Jiffy111,

can you start TurboPrint-Monitor by clicking on the "TurboPrint-Monitor" Desktop icon or from TurboPrint Control with the "Status Monitor" button?
The "startmonitor" script that you called is not really suited for that purpose as it also tries to copy desktop applets into system folders. Your error messages are all related to the applets.
In case TurboPrint Monitor says "TurboPrint Daemon not started", also check in TurboPrint Control if the "TurboPrint Monitor - start daemon when booting" option is activated.

Re: turboprint-startmonitor doesn't run

Posted: Thu Jul 22, 2021 6:05 pm
by Jiffy1111
It does start from the menu, but I do not have the tray applet/notification icon anymore.
I guess that is the real problem I was trying to express.

Re: turboprint-startmonitor doesn't run

Posted: Mon Jul 26, 2021 2:50 pm
by zedonet
The Applet is just a small add-on to TurboPrint and not supported on all Linux systems where TurboPrint works. A reason is the variety of different Desktop types and variations which would need adaptions or own versions of the applet.

Re: turboprint-startmonitor doesn't run

Posted: Tue Jul 27, 2021 2:08 pm
by Jiffy1111
Ok, but it has been working for me on Arch since I purchased this, and that was about three years ago.
I'm guessing a recent update broke it, but I didn't notice it right away.

Re: turboprint-startmonitor doesn't run

Posted: Fri Oct 22, 2021 10:26 am
by Jiffy1111
Hi, any news/update?
Thank you.

Re: turboprint-startmonitor doesn't run

Posted: Fri Apr 01, 2022 5:02 am
by le_avion
Here is what I had to do to get it working on POP-OS 21.10 with Python 3. Before you make any changes, make sure you backup everything you are about to change. No warranty what-so-ever as your system may be different so YMMV.

Important: make sure you use an editor that respects python indentation rules or the modified code will not run
  • I had to install gir1.2-appindicator3-0.1
  • I saved a backup of /usr/lib/turboprint/appindicator/tpapplet.py and modified it:
  • Changed the first line to allow python 3 to be used (assuming that this is your default)

    Code: Select all

    #!/usr/bin/env python
  • Added the follwing two lines beloow that:

    Code: Select all

    import gi
    gi.require_version('Gtk', '3.0')
Here is how the top of my tpapplet.py file looks like:

Code: Select all

#!/usr/bin/env python

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import GLib
from gi.repository import AppIndicator3 as appindicator
from gi.repository import Notify as notifyclass

That's it. If you run it from the command line you will see some python warnings about deprecated formats, functions, etc. That's fine.

Re: turboprint-startmonitor doesn't run

Posted: Fri Jul 15, 2022 9:54 am
by Jiffy1111
Thank le_avion, I am running Arch linux and removing gtk4 resolves the issue for me.

My python 2 environment is still around for this application only and it is working well.
I hope there are fixes being worked on for these because there will come a time when I will not be able to keep the old python environment alive and I will have a need for gtk4, which at that point will break Turboprint.

Can someone from Zedonet please update us with information about what is being worked on and when we can expect it?

Thank you.

Re: turboprint-startmonitor doesn't run

Posted: Mon Nov 07, 2022 10:46 am
by Jiffy1111
The day has come where I need GTK4 and following le_avion's advice resulted in:

Code: Select all

/usr/lib/turboprint/appindicator/tpapplet.py
  File "/usr/lib/turboprint/appindicator/tpapplet.py", line 62
    data.notification.close()
TabError: inconsistent use of tabs and spaces in indentation
Top of my file:

Code: Select all

#!/usr/bin/env python
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import GLib
from gi.repository import AppIndicator3 as appindicator
from gi.repository import Notify as notifyclass
ZEDOnet, please fix.

Thank you,
Jiffy