Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Git Version | Version Git Bug applets externes BZR avec Archlinux et dérivés
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Git Version | Version Git

Subjects Author Language Messages Last message
[Locked] Bug applets externes BZR avec Archlinux et dérivés
Page : 1 2
lylambda Français 33 matttbe [Read]
22 September 2013 à 18:44

lylambda, Friday 06 September 2013 à 10:10


Subscription date : 06 September 2009
Messages : 1635
Sujet ouvert pour rapporter tout problèmes concernants les versions BZR des applets externes avec Archlinux et dérivés.
Précédemment voir http://glx-dock.org/bg_topic.php?t=7069&pos=80#mess_80690

Quote :
Est-ce que c'est mieux avec la rev 406?
non , on se retrouve dans la situation du 404.

cairo-dock -> pClassAppli->cStartupWMClass: (null)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/icon)
_write_modules_idle (switcher;logout;weather;Animated icons;Remote-Control;dustbin;netspeed;Folders;shortcuts;Transmission;AlsaMixer;Quote;System Monitor;musicPlayer;dnd2share;showDesktop;Clipper;clock;PowerManager)
update_module_state (Quote)
Traceback (most recent call last):
File "./Quote", line 216, in <module>
Applet().run()
File "/usr/lib/python3.3/site-packages/CDApplet.py", line 165, in run
self.begin()
File "./Quote", line 194, in begin
self.get_quotes_from_web()
File "./Quote", line 155, in get_quotes_from_web
quote, author = interface.fetch()
File "./Quote", line 110, in fetch
parser.parse(page.read()) # feed the parser with the page's content
File "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/ChucknorrisfactsfrParser.py", line 32, in parse
self.feed(str(page).encode('utf8')) # feed the parser with the page's html
File "/usr/lib/python3.3/site-packages/sgmllib.py", line 97, in feed
self.rawdata = self.rawdata + data
TypeError: Can't convert 'bytes' object to str implicitly

matttbe, Friday 06 September 2013 à 13:05


Subscription date : 24 January 2009
Messages : 12573
Merci! J'ai revert la modif, il va falloir utiliser une alternative à sgmllib... Le problème c'est qu'en python3, de l'utf-8, ce n'est pas une string normale. Ou alors, il faudrait p-e faire en decode mais je ne sais pas tester car chez moi, cette lib n'est pas dispo pour python3. À la ligne 32 de /usr/share/cairo-dock/plug-ins/Dbus/third-party/ Quote/ChucknorrisfactsfrParser.py,pourrais-tu tester avec
self.feed(str(page).decode('utf8'))

lylambda, Friday 06 September 2013 à 14:00


Subscription date : 06 September 2009
Messages : 1635
Aprés mise à jour des extras, 'ai remplacé "self.feed(str(page))" par "self.feed(str(page).decode('utf8'))", mais cette modif ne semble pas fonctionner :

100blagues.com non fonctionnel sans modif manuels:
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "./Quote", line 169, in show_quote
current = next(self.quotes)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(*args, **kwargs)
File "./Quote", line 207, in on_click
self.show_quote()
File "./Quote", line 172, in show_quote
current = next(self.quotes) # get the first
StopIteration


Chucknorrisfacts.fr ne fonctionne pas avec ta modif :
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/icon)
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(*args, **kwargs)
File "/usr/lib/python3.3/site-packages/CDApplet.py", line 291, in _on_reload
self.reload()
File "./Quote", line 202, in reload
self.get_quotes_from_web() # refresh the quotations
File "./Quote", line 155, in get_quotes_from_web
quote, author = interface.fetch()
File "./Quote", line 110, in fetch
parser.parse(page.read()) # feed the parser with the page's content
File "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/ChucknorrisfactsfrParser.py", line 33, in parse
self.feed(str(page).decode('utf8'))
AttributeError: 'str' object has no attribute 'decode'
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "./Quote", line 169, in show_quote
current = next(self.quotes)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(*args, **kwargs)
File "./Quote", line 207, in on_click
self.show_quote()
File "./Quote", line 171, in show_quote
self.get_quotes_from_web() # fetch more
File "./Quote", line 155, in get_quotes_from_web
quote, author = interface.fetch()
File "./Quote", line 110, in fetch
parser.parse(page.read()) # feed the parser with the page's content
File "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/ChucknorrisfactsfrParser.py", line 33, in parse
self.feed(str(page).decode('utf8'))
AttributeError: 'str' object has no attribute 'decode'
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "./Quote", line 169, in show_quote
current = next(self.quotes)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(*args, **kwargs)
File "./Quote", line 207, in on_click
self.show_quote()
File "./Quote", line 171, in show_quote
self.get_quotes_from_web() # fetch more
File "./Quote", line 155, in get_quotes_from_web
quote, author = interface.fetch()
File "./Quote", line 110, in fetch
parser.parse(page.read()) # feed the parser with the page's content
File "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/ChucknorrisfactsfrParser.py", line 33, in parse
self.feed(str(page).decode('utf8'))
AttributeError: 'str' object has no attribute 'decode'


Idem pour Viedemerde.fr :
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/icon)
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(*args, **kwargs)
File "/usr/lib/python3.3/site-packages/CDApplet.py", line 291, in _on_reload
self.reload()
File "./Quote", line 202, in reload
self.get_quotes_from_web() # refresh the quotations
File "./Quote", line 155, in get_quotes_from_web
quote, author = interface.fetch()
File "./Quote", line 110, in fetch
parser.parse(page.read()) # feed the parser with the page's content
File "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/ViedemerdeParser.py", line 43, in parse
self.feed(str(page).decode('utf8'))
AttributeError: 'str' object has no attribute 'decode'
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "./Quote", line 169, in show_quote
current = next(self.quotes)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(*args, **kwargs)
File "./Quote", line 207, in on_click
self.show_quote()
File "./Quote", line 171, in show_quote
self.get_quotes_from_web() # fetch more
File "./Quote", line 155, in get_quotes_from_web
quote, author = interface.fetch()
File "./Quote", line 110, in fetch
parser.parse(page.read()) # feed the parser with the page's content
File "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/ViedemerdeParser.py", line 43, in parse
self.feed(str(page).decode('utf8'))
AttributeError: 'str' object has no attribute 'decode'


Par contre, sans modif, Bash.org fonctionne (avec bug de caractères):
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/icon)


Et aussi Quotationspage.com fonctionne sans bug de caractères apparent :
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Quote/icon)

lesebas, Tuesday 10 September 2013 à 22:50


Subscription date : 24 November 2008
Messages : 298
Salut,

Moi j'ai toujours le problème de Gmail, si le wifi n'est pas dispo au lancement du dock, ensuite impossible de mettre à jour l'applet avec les mails il reste désespérément en "Error!".

Le debug de Gmail:

[sebastien@Vulpus ~]$ cairo-dock -l debug --colors | sed -n "/Gmail\// {N;p;}"cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
debug : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-packages.c:cairo_dock_get_url_data_with_post:306)
launching distant applet with: 'cd "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail" && ./"Gmail" 3 "/org/cairodock/CairoDock/Gmail" "/home/sebastien/.config/cairo-dock/current_theme/plug-ins/Gmail/Gmail.conf" "/home/sebastien/.config/cairo-dock" cairo-dock 1333'
debug : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-utils.c:cairo_dock_launch_command_full:245)
cairo_dock_launch_command_full (cd "/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail" && ./"Gmail" 3 "/org/cairodock/CairoDock/Gmail" "/home/sebastien/.config/cairo-dock/current_theme/plug-ins/Gmail/Gmail.conf" "/home/sebastien/.config/cairo-dock" cairo-dock 1333 , (null))
debug : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-module-manager.c:gldi_module_activate:289)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
debug : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/Dbus/src/interface-applet-methods.c:cd_dbus_applet_show_dialog:768)


Ensuite si je clic sur mise à jour (ou clic du milieu) aprés la connexion wifi ça ne me retourne rien....

Le debug général, voila ce que j'ai quand je récupère le wifi :

message : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-backends-manager.c:cairo_dock_set_renderer:252)
cairo_dock_set_renderer (13f0400:(null))
message : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-load-icons.c:_weather_draw_current_conditions:69)
chargement de l'icone meteo (14de400)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/weather/7degrees/31.png)
message : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-load-icons.c:cd_weather_update_from_data:195)
revert to normal frequency


Par contre le raffraichissement de Gmail :

debug : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-container.c:cairo_dock_popup_menu_on_icon:442)
gtk_get_current_event_time: 847069
message : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-animations.c:gldi_icon_start_animation:243)
gldi_icon_start_animation (Gmail, 1)


Autant dire rien...

matttbe, Tuesday 10 September 2013 à 23:01


Subscription date : 24 January 2009
Messages : 12573
Pour les applets externes (third-party/extras), pourrais-tu lancer le dock sans l'option de debug (juste lancer cairo-dock) car je ne vois pas s'il y a une erreur avec python?

Est-ce que tu utilises bien la dernière révision?

lesebas, Tuesday 10 September 2013 à 23:17


Subscription date : 24 November 2008
Messages : 298
sans debug avec rev 417:

[sebastien@Vulpus ~]$ cairo-dock
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/implementations/cairo-dock-glx.c:_initialize_opengl_backend:179)
couldn't find an appropriate visual, trying to get one without Stencil buffer
(it may cause some little deterioration in the rendering) ...

============================================================================
    Cairo-Dock version : 3.2.99.beta2
    Compiled date : Sep 9 2013 23:03:21
    Built with GTK : 3.8
    Running with OpenGL: 0
============================================================================

warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/Dbus/src/applet-dbus.c:cd_dbus_register_module_in_dir:176)
file /usr/share/cairo-dock/plug-ins/Dbus/third-party/list.conf/auto-load.conf should not be here
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/Dbus/src/applet-dbus.c:cd_dbus_register_module_in_dir:176)
file /usr/share/cairo-dock/plug-ins/Dbus/third-party/Applets-python2.list/auto-load.conf should not be here
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/Dbus/src/applet-dbus.c:cd_dbus_register_module_in_dir:176)
file /usr/share/cairo-dock/plug-ins/Dbus/third-party/demos/auto-load.conf should not be here
sh : ligne 1 : 4394 Processus arrêté ./"Google" 1 "/org/cairodock/CairoDock/Google" "/home/sebastien/.config/cairo-dock/current_theme/plug-ins/Google/Google.conf" "/home/sebastien/.config/cairo-dock" cairo-dock 4387
libreoffice-writer -> pClassAppli->cStartupWMClass: libreoffice-writer
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-packages.c:cairo_dock_list_net_packages:640)
couldn't retrieve packages on http://download.tuxfamily.org/glxdock/themes (check that your connection is alive, or retry later)
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-packages.c:cairo_dock_list_packages:712)
while listing distant packages in 'http://download.tuxfamily.org/glxdock/themes/third-party/3.3.0' : Couldn't download file 'http://download.tuxfamily.org/glxdock/themes/third-party/3.3.0/list.conf' (Couldn't resolve host name)
shotwell -> pClassAppli->cStartupWMClass: (null)
wine -> pClassAppli->cStartupWMClass: (null)
gimp -> pClassAppli->cStartupWMClass: (null)
xfce4-terminal -> pClassAppli->cStartupWMClass: (null)
chromium -> pClassAppli->cStartupWMClass: (null)
thunderbird -> pClassAppli->cStartupWMClass: (null)
libreoffice-calc -> pClassAppli->cStartupWMClass: libreoffice-calc
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Google/icon)
GldiShortkey '<Control>F12' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F12' (Se déconnecter: Afficher le menu de déconnexion)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Facebook/icon)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-read-data.c:cd_weather_get_distant_data:308)
while downloading current conditions data:
http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m -> Couldn't download file 'http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m' (Couldn't resolve host name)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_empty.svg)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/showDesktop/icon.png)
GldiShortkey '<Control>F4' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F4' (Afficher le Bureau: Exposé de tous les bureaux)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/weather/7degrees/na.png)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_full.svg)
wicd-client ---> (null)
pacmanxg -> pClassAppli->cStartupWMClass: (null)
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon.svg)
...updating Facebook Applet
PHP Warning: require_once(): open_basedir restriction in effect. File(/usr/lib/facebook/facebook.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in /usr/lib/fbcmd.php on line 534
PHP Warning: require_once(/usr/lib/facebook/facebook.php): failed to open stream: Operation not permitted in /usr/lib/fbcmd.php on line 534
PHP Fatal error: require_once(): Failed opening required 'facebook/facebook.php' (include_path='.:/usr/share/pear') in /usr/lib/fbcmd.php on line 534
...Facebook Applet could not connect to the Internet. Trying later.
[+] Google: Applet started
cairo_dock_create_surface_from_image: assertion `cImagePath != NULL' failed
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)

matttbe, Tuesday 10 September 2013 à 23:46


Subscription date : 24 January 2009
Messages : 12573
Mmh, je ne vois aucune plainte de la part de GMail
Et un clic gauche t'affiche la liste des mails non lus?

PS: pour le PKGBUILD, je vois qu'il y a des fichiers qui ne devraient pas s'y trouver.
Pourrais-tu remplacer la ligne:
rm -rf locale.bak po .bzr .bzrignore *.sh list.conf
par:
rm -rf locale.bak po .bzr .bzrignore *.sh list.conf Applets-python2.list demos
ET placer le code à décommenter AVANT cette ligne avec rm
  for i in `cat Applets-python2.list`; do 
    if [ -
x $i/$i ]; then 
      sed 
--follow-symlinks -"1s/python/python2/"  $i/$i 
    fi 
  done

  rm 
-rf locale.bak po .bzr .bzrignore *.sh list.conf Applets-python2.list demos

lesebas, Wednesday 11 September 2013 à 22:33


Subscription date : 24 November 2008
Messages : 298
Oui le clic gauche fonctionne une fois le dock démarré aprés la connection wifi.

OK AUR mis à jour.

matttbe, Wednesday 11 September 2013 à 22:58


Subscription date : 24 January 2009
Messages : 12573
lesebas :
Oui le clic gauche fonctionne une fois le dock démarré aprés la connection wifi.
Tu as bien un soucis avec l'icône? Car je n'ai jamais eu ce problème mais je vais être plus attentif.

OK AUR mis à jour.
Merci!

PS: en parlant de AUR, il y a un typo à la ligne:
'gtg: GTG [AUR']
(le dernier "'" est mal placé)
Et aussi, pourrais-tu décommenter (enlever les '#') ces lignes?
  # for i in `cat Applets-python2.list`; do 
  #   if [ -x $i/$i ]; then 
  #     sed --follow-symlinks -i "1s/python/python2/"  $i/$i 
  #   fi 
  # done
(et tu peux aussi enlever la ligne: )
## TODO: force python2 ##

lesebas, Wednesday 11 September 2013 à 23:08


Subscription date : 24 November 2008
Messages : 298
OK a jour!

matttbe, Wednesday 11 September 2013 à 23:12


Subscription date : 24 January 2009
Messages : 12573
Merci pour la réactivité

lesebas, Thursday 12 September 2013 à 09:42


Subscription date : 24 November 2008
Messages : 298
matttbe :
Tu as bien un soucis avec l'icône? Car je n'ai jamais eu ce problème mais je vais être plus attentif.


Non pas vraiment un soucis d'icone. En fait le dock se lance avant que la connexion wifi soit établie. Quand celle-ci devient active je n'ai pas de problèmes d'actualisation de données avec d'autres applets (exemple Météo), par contre Gmail reste toujours en erreur de connexion (temps d'actualisation à 1 minute) même si je fais un clic milieu ou clic droit + "actualiser". Je dois redémarrer le dock pour que ça rentre dans l'ordre.

matttbe, Thursday 12 September 2013 à 13:46


Subscription date : 24 January 2009
Messages : 12573
par contre Gmail reste toujours en erreur de connexion
C'est-à-dire ? Tu as une icône avec un attention? Un label d'erreur ou une info rapide devant l'icône?

lesebas, Thursday 12 September 2013 à 22:50


Subscription date : 24 November 2008
Messages : 298
Exactement c'est ça :

http://img708.imageshack.us/img708/4512/p2iq.png

Par contre pour essayer d'avancer j'ai supprimé les fichiers suivants :

~/config/cairo-dock/.Gmail_subscription
~/.config/cairo-dock/current_theme/plug-ins/Gmail/

Depuis quand je démarre le dock il me demande mon login et mot de passe... mais ne les sauvegarde pas il faut que je me ressaisisse à chaque redémarrage du dock!

le log :

[sebastien@Vulpus ~]$ cairo-dock
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/implementations/cairo-dock-glx.c:_initialize_opengl_backend:179)
couldn't find an appropriate visual, trying to get one without Stencil buffer
(it may cause some little deterioration in the rendering) ...

============================================================================
    Cairo-Dock version : 3.2.99.beta2
    Compiled date : Sep 9 2013 23:03:21
    Built with GTK : 3.8
    Running with OpenGL: 0
============================================================================

warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/Dbus/src/applet-dbus.c:_cd_dbus_register_new_module:124)
this module (Google) is already registered
libreoffice-writer -> pClassAppli->cStartupWMClass: libreoffice-writer
shotwell -> pClassAppli->cStartupWMClass: (null)
wine -> pClassAppli->cStartupWMClass: (null)
gimp -> pClassAppli->cStartupWMClass: (null)
xfce4-terminal -> pClassAppli->cStartupWMClass: (null)
chromium -> pClassAppli->cStartupWMClass: (null)
thunderbird -> pClassAppli->cStartupWMClass: (null)
libreoffice-calc -> pClassAppli->cStartupWMClass: libreoffice-calc
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Google/icon)
GldiShortkey '<Control>F12' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F12' (Se déconnecter: Afficher le menu de déconnexion)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_empty.svg)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/showDesktop/icon.png)
GldiShortkey '<Control>F4' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F4' (Afficher le Bureau: Exposé de tous les bureaux)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_full.svg)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon.svg)
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
[+] Google: Applet started
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/weather/7degrees/26.png)
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(*args, **kwargs)
File "./Gmail", line 525, in on_answer_dialog
self.add_subscription()
File "./Gmail", line 202, in add_subscription
'\n'+self.account['password']).encode('ascii')))
TypeError: must be str, not bytes
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
Lecture WAVE '/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/snd/pop.wav' : Float 32 bit Little Endian, Fréquence 44100 Hz, Stéréo
gldi_desktop_background_destroy: assertion `pDesktopBg != NULL' failed
_detach_icon (Google)
_detach_icon (Se déconnecter)
_detach_icon (Talant, France)
_detach_icon (Désactiver l'écran de veille)
_detach_icon (Gmail)
>>> applet 'Gmail' terminated.
>>> applet 'Screensaver_inhibitor' terminated.
_detach_icon (Corbeille)
_detach_icon (sebastien)
_detach_icon (Raccourcis)
_detach_icon (HDA Intel PCH: 86%)
_detach_icon (Banshee)
_detach_icon (Afficher le Bureau)


Puis quand je relance :

[sebastien@Vulpus ~]$ cairo-dock
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/implementations/cairo-dock-glx.c:_initialize_opengl_backend:179)
couldn't find an appropriate visual, trying to get one without Stencil buffer
(it may cause some little deterioration in the rendering) ...

============================================================================
    Cairo-Dock version : 3.2.99.beta2
    Compiled date : Sep 9 2013 23:03:21
    Built with GTK : 3.8
    Running with OpenGL: 0
============================================================================

warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/Dbus/src/applet-dbus.c:_cd_dbus_register_new_module:124)
this module (Google) is already registered
libreoffice-writer -> pClassAppli->cStartupWMClass: libreoffice-writer
shotwell -> pClassAppli->cStartupWMClass: (null)
wine -> pClassAppli->cStartupWMClass: (null)
gimp -> pClassAppli->cStartupWMClass: (null)
xfce4-terminal -> pClassAppli->cStartupWMClass: (null)
chromium -> pClassAppli->cStartupWMClass: (null)
thunderbird -> pClassAppli->cStartupWMClass: (null)
libreoffice-calc -> pClassAppli->cStartupWMClass: libreoffice-calc
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Google/icon)
GldiShortkey '<Control>F12' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F12' (Se déconnecter: Afficher le menu de déconnexion)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_empty.svg)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/showDesktop/icon.png)
GldiShortkey '<Control>F4' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F4' (Afficher le Bureau: Exposé de tous les bureaux)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_full.svg)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon.svg)
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
[+] Google: Applet started
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/weather/7degrees/27.png)

matttbe, Friday 13 September 2013 à 12:11


Subscription date : 24 January 2009
Messages : 12573
Yop,

les 2 bugs devraient être fixés, à confirmer

lesebas, Friday 13 September 2013 à 18:12


Subscription date : 24 November 2008
Messages : 298
Oui pour les infos de login... par contre toujours le même problème si le dock est lancé avant la connexion réseau

matttbe, Friday 13 September 2013 à 20:51


Subscription date : 24 January 2009
Messages : 12573
Quelles options as-tu choisi dans le panneau de config? Peux-tu partager le fichier ~/.config/cairo-dock/current_theme/plug-ins/Gmail/Gmail.conf? (il ne contient pas d'info perso )

Je n'arrive pas à reproduire ce bug (je me déconnecte, je relance l'applet, je me reconnecte, j'actualise et je n'ai plus le label ou l'icône d'erreur)

Si tu choisis d'afficher une icône au lieu d'un label (dernière option), as-tu ce même problème?

lesebas, Saturday 14 September 2013 à 08:18


Subscription date : 24 November 2008
Messages : 298
Voila mon gmail.conf :

#13.08.28

#[gtk-about]

[Icon]

#F[Icon]
frame_maininfo=

#d Name of the dock it belongs to:
dock name=

#s[Default] Name of the icon as it will appear in its caption in the dock:
name=
#v
sep_display=

icon=

#j+[0;400] Desired icon size for this applet
#{Set to 0 to use the default applet size}
icon size=0;0

#Y+[No;0;0;With default background;0;0;With custom background;1;1] Always display the icon, even when the dock is hidden?
always_visi=0

#C+ Background color to add in this case
bg color=.8;.8;.8;.5

order
=5.8125

#A
handbook=Gmail


#[gtk-convert]

[Desklet]

#X[Position]
frame_pos=

#b Lock position?
#{If locked, the desklet cannot be moved by simply dragging it with the left mouse button. It can still be moved with ALT + left-click.}
locked=false

#j+[24;512] Desklet dimensions (width x height):
#{Depending on your WindowManager, you may be able to resize this with ALT + middle-click or ALT + left-click.}
size=96;96;

#i[-2048;2048] Desklet position (x, y):
#{Depending on your WindowManager, you may be able to move this with ALT + left-click.. Negative values are counted from the right/bottom of the screen}
x position=0
#i[-2048;2048] ...
y position=0

#I[-180;180] Rotation:
#{You can quickly rotate the desklet with the mouse, by dragging the little buttons on its left and top sides.}
rotation=0

#X[Visibility]
frame_visi=

#b Is detached from the dock
initially detached=false
#l[Normal;Keep above;Keep below;Keep on widget layer;Reserve space] Visibility:
accessibility=0
#b Should be visible on all desktops?
sticky=true


#F[Decorations;gtk-orientation-portrait]
frame_deco=

#o+ Choose a decoration theme for this desklet:
#{Choose 'Custom decorations' to define your own decorations below.}
decorations=default

#v
sep_deco=

#g+ Background image:
#{Image to be displayed below drawings, e.g. a frame. Leave empty for no image.}
bg desklet=
#e+[0;1] Background transparency:
bg alpha=1
#i+[0;256] Left offset:
#{in pixels. Use this to adjust the left position of drawings.}
left offset=0
#i+[0;256] Top offset:
#{in pixels. Use this to adjust the top position of drawings.}
top offset=0
#i+[0;256] Right offset:
#{in pixels. Use this to adjust the right position of drawings.}
right offset=0
#i+[0;256] Bottom offset:
#{in pixels. Use this to adjust the bottom position of drawings.}
bottom offset=0
#g+ Foreground image:
#{Image to be displayed above the drawings, e.g. a reflection. Leave empty for no image.}
fg desklet=
#e+[0;1] Foreground tansparency:
fg alpha=1


#[gtk-preferences]

[Configuration]

#i[1;120] Delay between refreshes:
#{(in minutes)}
UPDATE=1

#F[Alerts;gtk-execute]
frame2=

#B[3] Show alerts?
NOTIFY=true
#B- Show animation?
#{Should an animation be applied to the icon?}
ANIM=true
#a Choose animation?
#{Which animation should the apply to the icon?}
HOW=
#b Show dialogue?
#{Should the applet display a dialogue box with the notification?}
DIA=true
#B- Play a sound?
#{Should the applet play a sound with the notification?}
SOUND=true
#u[Default] Path to sound file:
#{Several files are available in ~/.config/cairo-dock/third-party/Gmail/snd/}
WAV=

#v
sep_count=

#B- Display a counter on the icon?
COUNT=true
#L+[small emblem;large emblem;quickinfo] How?
#{Do you want an emblem or a quick-info label to be displayed?}
INFO=quickinfo



J'ai désactivé les étiquettes mais ce n'est pas mieux!...

Au passage comportement bizarre de logout, avec 2 utilisateurs de logués, aucun problème pour éteindre le PC par contre ça bloque (je pense que c'est normal) pour redémarrer :

dit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F4' (Afficher le Bureau: Exposé de tous les bureaux)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_full.svg)
xfce4-terminal --> (null)
xfce4-terminal --> (null)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon.svg)
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
[+] Google: Applet started
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/weather/7degrees/28.png)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/logout/src/applet-logout.c:cd_logout_get_users_list:1105)
Couldn't get info on the bus from org.freedesktop.Accounts (The name org.freedesktop.Accounts was not provided by any .service files)
-> Trying from GnomeDisplayManager.
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/logout/src/applet-logout.c:_get_users_list_gdm:1022)
Couldn't get users on the bus from org.gnome.DisplayManager (The name org.gnome.DisplayManager was not provided by any .service files)
-> Using a fallback method.
gtk_device_grab_add: assertion `GDK_IS_DEVICE (device)' failed
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/logout/src/applet-logout.c:_logind_action:625)
Logind error: Operation not permitted

matttbe, Saturday 14 September 2013 à 11:21


Subscription date : 24 January 2009
Messages : 12573
Non, je viens de tester et pas de soucis... Un clic du milieu au retour de connexion fixe le problème.
Et tu n'as pas de tracebacks ou d'erreurs dans le terminal quand tu as ce problème?
Pourrais-tu éditer le script et y ajouter des 'print()', par exemple afficher juste le numéro de ligne, ce serait déjà bien:
print (inspect.getframeinfo(inspect.currentframe())[1])
(attention, faut ajouter au début du fichier import inspect )

Ce qu'il faut regarder en priorité, c'est vérifier si la fonction update_display() est bien appelée (en ajoutant un print au début de la fonction, après le block en commentaire avec les 3 guillemets):
  • Si non, il faut voir où ça cale dans la fonction check_mail() en y rajoutant des prints un peu partout.
  • Si oui, pourrais-tu lancer la commande dbus-monitor et poster ici tous les messages reçu après avoir fait un clic du milieu sur l'applet.


@all: Quelqu'un pourrait également tenter de reproduire le bug?

EDIT: pour le bug avec logout, je ne pense pas que ça soit de la faute du dock mais un soucis de permission (un truc du genre gnome polkit devrait prendre le relais). Mais pourrais-tu ouvrir un autre sujet pour ça?

lesebas, Monday 16 September 2013 à 23:11


Subscription date : 24 November 2008
Messages : 298
Salut,

J'ai modifie Gmail.py comme-ça :

#!/usr/bin/python

# This is a part of the external applets for Cairo-Dock
# Copyright : (C) 2011 by Benjamin
#
# 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.
# http://www.gnu.org/licenses/licenses.html#GPL

from CDApplet import CDApplet_

try:
    
import glib # used for timer
    
import gtk # used for Menu class displaying inbox
    
import libxml2 # used to parse XML content from Gmail inbox
except:
    
from gi.repository import GLib as glib
    from gi
.repository import Gtk as gtk
    from gi
.repository import Gdk as gdk
    from lxml import etree

import base64 
# used to encrypt and decrypt messaging accounts' passwords

try: # used to connect to Gmail
    
import urllib.request as _urllib # python 3
except:
    
import urllib2 as _urllib # python 2
import re # used to read Gmail headers at authentication
import os # used to find paths and to launch 'aplay'
import sys # used to find relative paths
import webbrowser

import SVGmaker 
# home-made module to edit SVG counter emblem

import inspect 

print (inspect.getframeinfo(inspect.currentframe())[1])

class 
Menu(gtk.Menu):

    
def __init__(selfinbox):
        
gtk.Menu.__init__(self)

        
# get all mail from inbox
        
for mail in inbox:
            
# check if mail has subject / title
            
if mail['title'] == None or len(mail['title']) == 0:
                
mail['title'] = '<i>(' _('No Subject') + ')</i>'
            
# create markups
            
string '<b>'+mail['author']+':</b>\n'+mail['title']
            
menu_item gtk.ImageMenuItem()
            
# the true label is set after with set_markup()
            
menu_item.set_label('')
            try:
                
menu_item.set_image(gtk.image_new_from_file('./img/menu-gmail.png'))
            
except:
                
menu_item.set_image(gtk.Image.new_from_file('./img/menu-gmail.png'))
            
menu_item.get_children()[0].set_markup(string)
            
menu_item.url mail['link']
            
menu_item.connect('activate'self.open_mailmail)
            
self.append(menu_item)
            
menu_item.show()
            
# add a separator if mail is not last in list
            
if inbox.index(mail) != len(inbox) - 1:
                
sep gtk.SeparatorMenuItem()
                
self.append(sep)
                
sep.show()

        
self.show()

    
def open_mail(selfmenumail=None):

        
""" Opens the mail URL """
        
try:
          
link mail['link']
          
webbrowser.open(link)
        
except webbrowser.Error:
          
os.popen('x-www-browser https://mail.google.com/mail')

class 
Gmail(CDApplet):

    
"""
        Main applet calling other agents to verify messages and sending signal
        to Cairo-Dock's icon.
    """

    
def __init__(self):

        
self.account = {} # accounts to which user subscribed
        
self.config = {} # user configuration
        
self.flag None # used to check current status (especially with dialogues)
        
self.path sys.argv[3][0:-10# relative path to config file's folder
        
self.subpath self.path+'../../../.Gmail_subscription' # file containing Gmail account details
        
self.svgpath self.path+'emblem.svg' # SVG emblem file
        
self.wav os.path.abspath("./snd/pop.wav")
        
self.rep False # used not to run more than one loop
        
CDApplet.__init__(self)

    
def get_config(selfkeyfile):

        
"""
            Gets configuration from configuration file.
        """

        
self.config['notify'] = keyfile.getboolean('Configuration''NOTIFY')
        
self.config['anim'] = keyfile.getboolean('Configuration''ANIM')
        
self.config['how'] = keyfile.get('Configuration''HOW')
        
self.config['dia'] = keyfile.getboolean('Configuration''DIA')
        
self.config['sound'] = keyfile.getboolean('Configuration''SOUND')
        
self.config['update'] = keyfile.getint('Configuration''UPDATE') * 60000
        self
.config['count'] = keyfile.getboolean('Configuration''COUNT')
        
self.config['info'] = keyfile.get('Configuration''INFO')
        
wav keyfile.get('Configuration''WAV')
        
# set default sound
        
if len(wav) > 0:
            
self.wav os.path.abspath(wav)
        
# set default animation
        
if len(self.config['how']) == 0:
            
self.config['how'] = 'default'

        
# in case user switched between emblem/quickinfo while count > 0
        
if self.account.get('count'0) > 0:
            
self.update_display()
        if 
self.flag == 'error':
            
self.error('')

    
def check_subscription(self):

        
"""
            Checks which accounts the user subsribed to, gets usernames and
            passwords as well as how often the account should be checked.
        """

        
# reset flag in case of prior error:
        
self.flag None

        
# open subscription file and read data
        
try:
            
file open(self.subpath'r')
            
sub file.read()
            
file.close()
        
except:
            
message _("Please fill in your Gmail account.")
            
self.error(message)
            return

        
# check if there was any data
        
if len(sub) < 1:
            
message _("Please fill in your Gmail account.")
            
self.error(message)
            return

        
# if so process the data
        
account base64.b64decode(sub.strip('\n').encode('ascii')).decode().split('\n')

        
# check if the data is correct
        
if len(account) != 2:
            
message _("Please fill in your Gmail account.")
            
self.error(message)
            return

        
# then process the data into account
        
self.account = {'username'account[0],
            
'password'account[1],
            
'count'0,
            
'diff'0}
        
        
self.check_mail()
        
self.repeat()

    
def add_subscription(selfrequest=None):

        
"""
            Prompts user to add subscription details.
        """

        
# if requesting new username:
        
if request == 'username':
            
# set dialogue flag to 'username'
            
self.flag 'username'
            
# prompt for username
            
message _("Please, enter your Gmail username:")
            
self.icon.PopupDialog({"message" message"buttons" "gtk-go-forward-ltr;cancel"},
                    {
"widget-type" "text-entry"})
        
# if requesting new password:
        
elif request == 'password':
            
# set dialogue flag to 'password'
            
self.flag 'password'
            
# prompt for password
            
message _("Please, enter your Gmail password:")
            
self.icon.PopupDialog({"message" message"buttons" "ok;cancel"},
                    {
"widget-type" "text-entry""visible" False})
        
# default request is to encrypt username and password
        
else:
            
# open, encode and write to subscription file
            
file open(self.subpath'wb')
            
file.write(base64.b64encode(str(self.account['username']+ \
            
'\n'+self.account['password']).encode('ascii')))
            
file.close()
            
# run subscription check as double check
            
self.check_subscription()
    
    
    
def check_mail_loop(self):
        
self.check_mail()
        return 
True
    
    def new_mail
(self):
        try:
          
link 'https://mail.google.com/mail/#compose'
          
webbrowser.open(link)
        
except webbrowser.Error:
          
os.popen('x-www-browser '+link)
    
    
def check_mail(selfanimate=False):  # animate is False by default, to not stop a demand of attention

        
"""
        Checks for new mail and requests notifications.
        """
        
if animate:
            
self.icon.Animate('busy',100)

        
# fetch inbox content from Gmail
        
data self.request_gmail()

        
# check if there is any content
        
if data == None:
            if 
animate:
                
self.icon.Animate('',0)
            return

        
# unpack and store XML
        
xml data.read()

        
# reading inbox
        
self.account['inbox'] = self.get_inbox(xml)

        if 
animate:
            
self.icon.Animate('',0)

        
# check if mail count could be retrieved
        
if self.account['inbox'] == None:
            return 

        
# parse inbox content to find number of new mails
        
count len(self.account['inbox'])

        
# update account information
        
self.account['diff'] = count self.account['count']
        
self.account['count'] = count

        
# update display
        
if self.account['diff'] != 0:
            
self.update_display()

        
# send notifications if there is new mail
        
if self.account['count'] > 0:
            
self.send_alert()
        
elif self.config['anim'] == True:  # no unread message, stop the previous animation
            
self.icon.DemandsAttention(False'')

    
def get_inbox(selfxml_data):

        
"""
            Counts the unreade messages from the XML inbox content.
        """

        
inbox = []

        try:
            try:
                
tree libxml2.parseDoc(xml_data)
                
path tree.xpathNewContext()
                
path.xpathRegisterNs('purl''http://purl.org/atom/ns#')
                
entries path.xpathEval('//purl:entry')
                if 
len(entries) > 0:
                    for 
entry in entries:
                        
path.setContextNode(entry)
                        
mail = {}
                        
mail['title'] = path.xpathEval('purl:title')[0].content
                        mail
['summary'] = path.xpathEval('purl:summary')[0].content
                        mail
['link'] = path.xpathEval('purl:link')[0].prop('href')
                        
mail['author'] = path.xpathEval('purl:author/purl:name')[0].content
                        inbox
.append(mail)
            
except:
                
tree etree.fromstring(xml_data)
                
namespaces = {'purl':'http://purl.org/atom/ns#'}
                
entries tree.xpath('purl:entry'namespaces namespaces)
                if 
len(entries) > 0:
                    for 
entry in entries:
                        
mail = {}
                        
mail['title'] = entry.xpath('purl:title'namespaces namespaces)[0].text
                        mail
['summary'] = entry.xpath('purl:summary'namespaces namespaces)[0].text
                        mail
['link'] = entry.xpath('purl:link'namespaces namespaces)[0].get('href')
                        
mail['author'] = entry.xpath('purl:author/purl:name'namespaces namespaces)[0].text
                        inbox
.append(mail)
            return 
inbox
        except
:
            
message _("WARNING: there was an error reading XML content.")
            
self.error(message)
            return 
None

    def request_gmail
(self):

        
"""
            Authenticates and requests inbox content from Gmail.
        """

        
gmailfeed 'https://mail.google.com/mail/feed/atom/'
        
request _urllib.Request(gmailfeed)

        
# connect to Gmail
        
error None
        
try:
            
handle _urllib.urlopen(request)
        
except IOError as err:
            
# here we will need "fail" as we receive a 401 error to get access
            
error err

        
if not hasattr(error'code') or error.code != 401:
            
# we got an error - but not a 401 error
            
message _("WARNING: Gmail applet failed to connect to Gmail atom feed.")
            
self.error(message)
            return 
None

        
# get the www-authenticate line from the headers
        
authline error.headers['www-authenticate']

        
# from this header we extract scheme and realm
        
authobject re.compile(
                                
r'''(?:\s*www-authenticate\s*:)?\s*(\w*)\s+realm=['"]([^'"]+)['"]''',
                                
re.IGNORECASE)
        
matchobject authobject.match(authline)

        
# make sure scheme and realm was found
        
if not matchobject:
            
message _("WARNING: Gmail atom feed is badly formed: ")
            
message authline
            self
.error(m)
            return 
None

        
# check what scheme we have
        
scheme matchobject.group(1)
        if 
scheme.lower() != 'basic':
            
message _("WARNING: Gmail Applet is not equipped for authentication other than BASIC.")
            return 
self.error(message)

        
# authenticate and get inbox content
        
account = ('%s:%s' % (self.account['username'], self.account['password'])).encode('ascii')
        
        
base64string base64.encodestring(account)[:-1].decode()
        
authheader "Basic %s" base64string
        request
.add_header("Authorization"authheader)
        try:
            
handle _urllib.urlopen(request)
        
except IOError as error:
            
# here we shouldn't fail if the username/password is right
            
message _("WARNING: Gmail username or password may be wrong.")
            
self.error(message)
            return 
None

        
return handle

    def update_display
(self):

        
"""
        Updates applet icon either with quickinfo or svg emblem.
        Only if new mail count is superior to 0.
        """
        
print
        
# if user does not want any counter on the icon
        
if self.config['count'] == False:
            
# clean up quick-info
            
self.icon.SetQuickInfo('')
            
# clean up icon
            
self.icon.SetIcon(os.path.abspath('./icon'))
            return

        
# otherwise
        
if self.config['info'] == 'quickinfo':
            
# clean up icon
            
self.icon.SetIcon(os.path.abspath('./icon'))
            if 
self.account['count'] == 0:
                
# reset quick-info
                
self.icon.SetQuickInfo('')
            else:
                
self.icon.SetQuickInfo(str(self.account['count']))

        else:
            
# reset quick-info (in case displayed before)
            
self.icon.SetQuickInfo('')
            
# check if emblem is necessary
            
if self.account['count'] == 0:
                
# reset icon
                
self.icon.SetIcon(os.path.abspath("./icon"))
            else:
                
# get size out of config
                
size self.config['info'].split()[0]
                
# make icon with external module SVGmaker
                
SVG SVGmaker.add_counter(self.account['count'], size)
                
svg open(self.svgpath'w')
                
svg.write(SVG)
                
svg.close()
                
# set icon with emblem
                
self.icon.SetIcon(self.svgpath)

    
def error(selfmessage):

        
"""
            Warns the user if an error occured.
        """

        
# no need to update the icon
        
if self.flag == 'error':
            return

        if 
self.config['info'] != 'quickinfo':
            
# remove previous quickinfo if needed:
            
self.icon.SetQuickInfo('')
            
# get size from config:
            
size self.config['info'].split()[0]
            
# pass size to filename:
            
file './img/gmail-error-'+size+'.svg'
            
# set icon with error emblem
            
self.icon.SetIcon(os.path.abspath(file))

        else:
            
# reset icon in case needed
            
self.icon.SetIcon(os.path.abspath('./icon'))
            
# set quickinfo:
            
self.icon.SetQuickInfo(_('Error!'))
        
# check if any error is already known
        # or if the user is changing subscription details
        
if self.flag != None:
            return
        
# set error flag
        
self.flag 'error'
        
self.account['count'] = -99 # to be sure that the icon will be updated
        # show dialogue
        
self.icon.ShowDialog(message4)

    
def send_alert(self):

        
"""
            Notifies user according to requirements.
        """

        
# check if user wants notifications
        
if self.config['notify'] == False:
            return

        
# check whether conditions are met
        
if self.account['diff'] <= 0:
            return
        
        
# check whether user wants an effect on the icon
        
if self.config['anim'] == True:
            
self.icon.DemandsAttention(Trueself.config['how'])

        
# check whether user wants a dialogue
        
if self.config['dia'] == True:
            
# checking our grammar ;) # we have at least one new email
            
if self.account['count'] > 1:
                
message _("You have %s new emails") % (str(self.account['count']))
            else:
                
message _("You have 1 new email")
            
self.icon.ShowDialog(message3)

        
# check whether user wants a sound
        
if self.config['sound'] == True:
            try:
                
os.popen('aplay ' self.wav)
            
except:
                
# restore default sound file if custom is corrupted
                
self.wav os.path.abspath("./snd/pop.wav")

    
def repeat(self):

        
"""
           Timer for postman to check messages.
           Will continue as long as check_messages returns True
        """
        
if self.rep == True:
            
pass
        
# set flag to tell the loop is running
        
self.rep True
        
# start timer loop
        
glib.timeout_add(self.config['update'], self.check_mail_loop)

    
def begin(self):

        
"""
            First method ran by CairoDock when applet is launched.
        """

        
###self.icon.SetLabel("Gmail")
        # the applet will not enter the loop until a subscription is found
        
self.check_subscription()

    
def on_answer_dialog(selfkeycontent):

        
"""
            Processes dialogue input for username and password.
        """

        
# check user pressed the first button (OK) or Enter
        
if key == or key == CDApplet.DIALOG_KEY_ENTER:
            
# check user entered something
            
if len(content) > 0:
                
# check if requesting username
                
if self.flag == 'username':
                    
# append account with username
                    
self.account['username'] = format(content)
                    
# request password
                    
self.add_subscription('password')
                
# check if requesting password
                
elif self.flag == 'password':
                    
# append account with password
                    
self.account['password'] = format(content)
                    
# finish up registration process
                    
self.add_subscription()
                else:
                    
# should not happen (kept in case another dialogue needs
                    # to be made in future).
                    
pass
            
else:
                
message _("Sorry, there was no input!")
                
self.error(message)

    
def on_build_menu(self):

        
"""
            Appends items to right-click menu.
        """

        
message_add_label _("Add or change subscription")
        
message_add_tooltip _("Use this to add or change your Gmail account details.")
        
message_middle_click _("middle-click")
        
message_check_label _("Check inbox now")
        
message_check_tooltip _("Check Gmail inbox now if you can't wait.")
        
message_new_mail _("Write a mail")
        
self.icon.AddMenuItems([{"widget-type" CDApplet.MENU_ENTRY,
        
"label"message_add_label,
        
"icon" "gtk-add",
        
"menu" CDApplet.MAIN_MENU_ID,
        
"id" 1,
        
"tooltip" message_add_tooltip},
        {
"widget-type" CDApplet.MENU_ENTRY,
        
"label"message_check_label " (" message_middle_click ")",
        
"icon" "gtk-refresh",
        
"menu" CDApplet.MAIN_MENU_ID,
        
"id" 2,
        
"sensitive" : (len(self.account) > 1), # at least 'count' => -99
        
"tooltip" message_check_tooltip},
        {
"widget-type" CDApplet.MENU_ENTRY,
        
"label"message_new_mail,
        
"icon" "gtk-new",
        
"menu" CDApplet.MAIN_MENU_ID,
        
"id" 3}])

    
def on_menu_select(selfiNumEntry):

        
"""
            Launches methods according to menu selection.
        """

        
if iNumEntry == 1:
            
self.add_subscription('username')
        
elif iNumEntry == 2:
            
self.check_mail(True)
        
elif iNumEntry == 3:
            
self.new_mail()

    
def on_click(selfiState):

        
"""
            Launches Gmail in default browser or application.
        """
        
        
if len(self.account) <= 1:  # no account -> start subscription
            
self.add_subscription('username')
        else:
            if 
self.account['count'] < 1:  # no message -> check now
                
self.check_mail(True)
            else:  
# some message(s) -> show the inbox
                
Menu(self.account['inbox'])
                
m.popup(parent_menu_shell=Noneparent_menu_item=Nonefunc=self.get_xydata=(400400),
                        
button=1activate_time=0)

    
def on_middle_click(self):
    
        
"""
            Check for new mails now.
        """
        
        
self.check_mail(True)

    
def get_xy(selfmdata):

        
# fetch icon geometry
        
icondata self.icon.GetAll()
        
iconContainer  icondata['container']
        
iconOrientation icondata['orientation']
        
iconWidth icondata['width']
        
iconHeight icondata['height']
        
iconPosX icondata['x']
        
iconPosY icondata['y']

        
# get menu geometry
        
try:
            
menuWidthmenuHeight m.size_request()
            
screenHeight gtk.gdk.screen_height()
        
except:
            
window m.get_parent_window()
            
menuWidth window.get_width()
            
menuHeight window.get_height()
            
screen gdk.Screen.get_default()
            
screenHeight screen.get_height()

        
# adapt to container and orientation
        
if iconContainer == 1:  # Then it's a desklet, always oriented in a bottom-like way.
            
if iconPosY['y'] < (screenHeight 2):
                
iconOrientation 1
            
else:
                
iconOrientation 0

        
if iconOrientation == 0:
            
# compute position of menu
            
iconPosX - (menuWidth 2)
            
iconPosY - (iconHeight 2) - menuHeight

        
else:
            
iconPosX - (menuWidth 2)
            
iconPosY + (iconHeight 2)

        return (
xyTrue)

if 
__name__ == "__main__":
    
gmail Gmail()
    
gmail.run()



Mais je ne vois pas trop de messages :

[sebastien@Vulpus ~]$ cairo-dock
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/implementations/cairo-dock-glx.c:_initialize_opengl_backend:179)
couldn't find an appropriate visual, trying to get one without Stencil buffer
(it may cause some little deterioration in the rendering) ...

============================================================================
    Cairo-Dock version : 3.2.99.beta2
    Compiled date : Sep 16 2013 22:58:09
    Built with GTK : 3.8
    Running with OpenGL: 0
============================================================================

sh : ligne 1 : 9219 Processus arrêté ./"Google" 1 "/org/cairodock/CairoDock/Google" "/home/sebastien/.config/cairo-dock/current_theme/plug-ins/Google/Google.conf" "/home/sebastien/.config/cairo-dock" cairo-dock 9212
libreoffice-writer -> pClassAppli->cStartupWMClass: libreoffice-writer
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-packages.c:cairo_dock_list_net_packages:640)
couldn't retrieve packages on http://download.tuxfamily.org/glxdock/themes (check that your connection is alive, or retry later)
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-packages.c:cairo_dock_list_packages:712)
while listing distant packages in 'http://download.tuxfamily.org/glxdock/themes/third-party/3.3.0' : Couldn't download file 'http://download.tuxfamily.org/glxdock/themes/third-party/3.3.0/list.conf' (Couldn't resolve host name)
shotwell -> pClassAppli->cStartupWMClass: (null)
wine -> pClassAppli->cStartupWMClass: (null)
gimp -> pClassAppli->cStartupWMClass: (null)
xfce4-terminal -> pClassAppli->cStartupWMClass: (null)
chromium -> pClassAppli->cStartupWMClass: (null)
thunderbird -> pClassAppli->cStartupWMClass: (null)
libreoffice-calc -> pClassAppli->cStartupWMClass: libreoffice-calc
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Google/icon)
GldiShortkey '<Control>F12' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F12' (Se déconnecter: Afficher le menu de déconnexion)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-read-data.c:cd_weather_get_distant_data:308)
while downloading current conditions data:
http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m -> Couldn't download file 'http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m' (Couldn't resolve host name)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_empty.svg)
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/showDesktop/icon.png)
GldiShortkey '<Control>F4' failed!
warning : (/var/abs/local/yaourtbuild/cairo-dock-bzr/src/cairo-dock-core/src/gldit/cairo-dock-keybinder.c:init_object:455)
Couldn't bind '<Control>F4' (Afficher le Bureau: Exposé de tous les bureaux)
This shortkey is probably already used by another applet or another application
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/weather/7degrees/na.png)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/dustbin/Silver/trashcan_full.svg)
wicd-client ---> (null)
thunar -> pClassAppli->cStartupWMClass: (null)
pacmanxg -> pClassAppli->cStartupWMClass: (null)
g_main_context_push_thread_default: assertion `acquired_context' failed
g_main_context_pop_thread_default: assertion `g_queue_peek_head (stack) == context' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
_cd_find_volume_name_from_drive_name: assertion `pDrive != NULL' failed
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Screensaver_inhibitor/icon.svg)
45
cairo_dock_set_image_on_icon (/usr/share/cairo-dock/plug-ins/Dbus/third-party/Gmail/icon)
[+] Google: Applet started
mousepad -> pClassAppli->cStartupWMClass: (null)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-read-data.c:cd_weather_get_distant_data:308)
while downloading current conditions data:
http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m -> Couldn't download file 'http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m' (Couldn't resolve host name)
_detach_icon (Gmail.py - Mousepad)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-read-data.c:cd_weather_get_distant_data:308)
while downloading current conditions data:
http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m -> Couldn't download file 'http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m' (Couldn't resolve host name)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-read-data.c:cd_weather_get_distant_data:308)
while downloading current conditions data:
http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m -> Couldn't download file 'http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m' (Couldn't resolve host name)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-read-data.c:cd_weather_get_distant_data:308)
while downloading current conditions data:
http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m -> Couldn't download file 'http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m' (Couldn't resolve host name)
warning : (/var/abs/local/yaourtbuild/cairo-dock-plugins-bzr/src/cairo-dock-plug-ins/weather/src/applet-read-data.c:cd_weather_get_distant_data:308)
while downloading current conditions data:
http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m -> Couldn't download file 'http://xml.weather.com/weather/local/FRXX6146?cc=*&unit=m' (Couldn't resolve host name)
cairo_dock_set_image_on_icon (/home/sebastien/.config/cairo-dock/extras/weather/7degrees/27.png)

Git Version | Version Git

Subjects Author Language Messages Last message
[Locked] Bug applets externes BZR avec Archlinux et dérivés
Page : 1 2
lylambda Français 33 matttbe [Read]
22 September 2013 à 18:44


Glx-Dock / Cairo-Dock List of forums Git Version | Version Git Bug applets externes BZR avec Archlinux et dérivés Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.