Page 1 sur 1

Problème Gkt avec Smart-Notifier

Posté : dim. 17 nov. 2019 13:59
par Mia88
Bonjour,

J'ai voulu tester si Smart-Notifier fonctionne correctement, j'ai ce retour du terminal :

Code : Tout sélectionner

mia@mia-PC5:~$ sudo sh -c 'echo test de message | smart-notifier –notify'
[sudo] Mot de passe de mia :   
/usr/share/smart-notifier/smart_notifier/gui.py:23: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Je ne récupère pas la main, ni avec q ni avec ctrl+C
Je comprends vaguement que la version installée n'est pas la bonne, je l'ai prise dans les dépôts, tout comme GSmartControl.

Quelqu'un peut m'aider ?
Merci

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 18 nov. 2019 10:06
par arghlub
Salut Mia,

Je n'utilise pas "smartmontools" mais y'avait déjà un bug avec Ubuntu 16.04 ( -> LM18) : https://bugs.launchpad.net/ubuntu/+sour ... ug/1646886
Sur ta LM18.3, cela fonctionne ?

;)

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 18 nov. 2019 11:46
par Mia88
Super merci arghlub, c'est le genre d'info que je galère toujours à trouver :(

Je reviendrai plus tard sur le sujet après avoir essayé avec la version 18.3 de Mint, j'ai eu besoin de la place occupée par ce PC, il est provisoirement au rencard :?

Je mets un attribut en cours ;)

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 6 avr. 2020 13:40
par Mia88
Mieux vaut tard que jamais, ben oui, voilà seulement que je remets mon 2ème PC en route :l

Ça fonctionne bien sur LM 18.3 ;)
Je passe l'attribut en abandon puisqu'il n'y a pas de solution...

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 6 avr. 2020 14:00
par Mia88
Merci cyrille, mais il est déjà installé

Code : Tout sélectionner

mia@mia-PC5:~$ sudo aptitude install python3-gi
[sudo] Mot de passe de mia :             
python3-gi est déjà installé avec la version demandée (3.26.1-2ubuntu1)
python3-gi est déjà installé avec la version demandée (3.26.1-2ubuntu1)
Aucun paquet ne va être installé, mis à jour ou enlevé.
0 paquets mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
Il est nécessaire de télécharger 0 o d'archives. Après dépaquetage, 0 o seront utilisés.
mia@mia-PC5:~$ 

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 6 avr. 2020 14:16
par Mia88

Code : Tout sélectionner

mia@mia-PC5:~$ sudo import gi
[sudo] Mot de passe de mia :             
import-im6.q16: not authorized `gi' @ error/constitute.c/WriteImage/1037.
mia@mia-PC5:~$ 

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 6 avr. 2020 15:14
par Mia88
Aptitude ou apt-get même résultat

Code : Tout sélectionner

mia@mia-PC5:~$ sudo aptitude install python-gi
python-gi est déjà installé avec la version demandée (3.26.1-2ubuntu1)
python-gi est déjà installé avec la version demandée (3.26.1-2ubuntu1)
Aucun paquet ne va être installé, mis à jour ou enlevé.
0 paquets mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
Il est nécessaire de télécharger 0 o d'archives. Après dépaquetage, 0 o seront utilisés.                                                        
mia@mia-PC5:~$ 
Pour le code à insérer dans l'entête, je comprends pas trop

Code : Tout sélectionner

mia@mia-PC5:~$ cd /usr/share/smart-notifier
mia@mia-PC5:/usr/share/smart-notifier$ ls
smart_notifier  smart-notifier  smart_notifier-0.28.egg-info
mia@mia-PC5:/usr/share/smart-notifier$ ls -l
total 12
drwxr-xr-x 2 root root 4096 févr.  4 10:26 smart_notifier
-rwxr-xr-x 1 root root  362 mai    1  2012 smart-notifier
drwxr-xr-x 2 root root 4096 févr.  4 10:26 smart_notifier-0.28.egg-info
mia@mia-PC5:/usr/share/smart-notifier$ cat smart-notifier
#!/usr/bin/python

import sys

# get a path to our private module, and make sure it overrides
# all other paths (This is probably Debian specific)
sys.path.insert(0, '/usr/share/smart-notifier')

if '--notify' in sys.argv:
    import smart_notifier
    smart_notifier.notify(sys.stdin.read())
else:
    import smart_notifier.gui
    smart_notifier.gui.service()
mia@mia-PC5:/usr/share/smart-notifier$ cd smart_notifier
mia@mia-PC5:/usr/share/smart-notifier/smart_notifier$ ls -l
total 32
-rw-r--r-- 1 root root  1901 mai    1  2012 gui.py
-rw-r--r-- 1 root root  1276 févr.  4 10:26 gui.pyc
-rw-r--r-- 1 root root  1408 mai    1  2012 __init__.py
-rw-r--r-- 1 root root  1273 févr.  4 10:26 __init__.pyc
-rw-r--r-- 1 root root 10566 mai    1  2012 smart-notifier.xml
-rw-r--r-- 1 root root     4 oct.   5  2006 version.txt
mia@mia-PC5:/usr/share/smart-notifier/smart_notifier$ cat gui.py
#
#This file is part of smart-notifier, a graphical disk health notifier
#
#Copyright (C) 2005, 2006  Brian Sutherland <jinty@web.de>
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

import os
import smart_notifier
from gi.repository import Gtk

here = os.path.dirname(__file__)

warning_window = os.path.join(here, 'smart-notifier.xml')

def warn_user(msg):
    #Make the window
    ui = Gtk.Builder()
    ui.add_from_file(warning_window)
    #self.ui.signal_connect('end', Gtk.main_quit)
    #Customize message
    textbuffer = Gtk.TextBuffer()
    textbuffer.set_text(msg)
    textbox = ui.get_object('textview1')
    textbox.set_buffer(textbuffer)
    # Fix the icon size XXX -- this is temporary intil gazpacho works
    icon = ui.get_object('image1')
    icon.set_from_stock(Gtk.STOCK_DIALOG_WARNING, Gtk.IconSize.DIALOG)
    # Showit
    window = ui.get_object('window1')
    window.show_all()

def service():
    smart_notifier.BUS.add_signal_receiver(warn_user,
                                           'warn_user',
                                           smart_notifier.UD_INTERFACE,
                                           smart_notifier.SERVICE_NAME,
                                           smart_notifier.UD_SERVICE)
    Gtk.main()
mia@mia-PC5:/usr/share/smart-notifier/smart_notifier$ 

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 6 avr. 2020 15:53
par Mia88
Après modif du fichier

Code : Tout sélectionner

mia@mia-PC5:~$ sudo sh -c 'echo test de message | smart-notifier –notify'
Traceback (most recent call last):
  File "/usr/bin/smart-notifier", line 13, in <module>
    import smart_notifier.gui
  File "/usr/share/smart-notifier/smart_notifier/gui.py", line 25, in <module>
    gi.require_version('Gtk', '3.0')
NameError: name 'gi' is not defined
mia@mia-PC5:~$ 

Re: Problème Gkt avec Smart-Notifier

Posté : lun. 6 avr. 2020 16:16
par Mia88
là il ne se passe plus rien, je perds la main sur le terminal
et je ne peux sortir ni avec q, ni ctrl+c, ni ctrl+d

Re: Problème Gkt avec Smart-Notifier

Posté : mar. 7 avr. 2020 10:29
par Mia88
slt cyrille

Je mets un extrait en cas où j'aurais mal fait, mis au mauvais endroit ou je ne sais quoi :

Code : Tout sélectionner

#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

import os
import smart_notifier

#from gi.repository import Gtk
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

here = os.path.dirname(__file__)

warning_window = os.path.join(here, 'smart-notifier.xml')

def warn_user(msg):
Donc, aucun changement en modifiant l'entête.

je vois pas d'erreur en rapport dans le journal au moment ou j'ai passé la commande (à env 9h)
les autres erreurs sont là depuis longtemps (c'était juste après la sortie de veille)

Code : Tout sélectionner

avril 07 08:31:51 mia-PC5 kernel: ACPI Error: Field [IRQE] at bit offset/length 136/16 exceeds size of target Buffer (128 bits) (20170831/dsopcode-235)
avril 07 08:31:51 mia-PC5 kernel: ACPI Error: Method parse/execution failed \_SB.PCI0.LPCB.SIO1.DSRS, AE_AML_BUFFER_LIMIT (20170831/psparse-550)
avril 07 08:31:51 mia-PC5 kernel: ACPI Error: Method parse/execution failed \_SB.PCI0.LPCB.UAR1._SRS, AE_AML_BUFFER_LIMIT (20170831/psparse-550)
avril 07 08:31:51 mia-PC5 kernel: serial 00:06: activation failed
avril 07 08:31:51 mia-PC5 kernel: dpm_run_callback(): pnp_bus_resume+0x0/0xa0 returns -5
avril 07 08:31:51 mia-PC5 kernel: PM: Device 00:06 failed to resume: error -5
avril 07 08:31:51 mia-PC5 systemd-rfkill[9432]: Failed to open device rfkill11: No such device
avril 07 08:31:56 mia-PC5 wpa_supplicant[1010]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (none) none
avril 07 08:31:56 mia-PC5 wpa_supplicant[1010]: dbus: Failed to construct signal
avril 07 08:31:58 mia-PC5 wpa_supplicant[1010]: bgscan simple: Failed to enable signal strength monitoring
lines 3375-3430/3430 (END
Mais ça n'est plus très important pour moi, j'ai contourné le problème il y a qq semaines avec un script journalier qui arrive dans ma boite mail, merci de t'être intéressé au problème ;)