pacho       15/04/26 12:22:43

  Added:                gdevilspie-0.5-paths.patch
  Log:
  Fix bug #539638, thanks a lot to Agustin Ferrari
  
  (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 
A188FBD4)

Revision  Changes    Path
1.1                  x11-misc/gdevilspie/files/gdevilspie-0.5-paths.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-misc/gdevilspie/files/gdevilspie-0.5-paths.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-misc/gdevilspie/files/gdevilspie-0.5-paths.patch?rev=1.1&content-type=text/plain

Index: gdevilspie-0.5-paths.patch
===================================================================
--- /home/usuario/Escritorio/gdevilspie 2015-04-26 03:30:16.760326671 -0300
+++ /usr/lib/python-exec/python2.7/gdevilspie   2015-04-26 03:32:11.247227671 
-0300
@@ -48,6 +48,10 @@
 DISABLE_XDG=""
 try:
     import xdg.DesktopEntry
+    if xdg.DesktopEntry.__dict__.has_key('xdg_config_home') == True:
+        xdg_config_home = xdg.DesktopEntry.xdg_config_home 
+    else:
+        xdg_config_home = os.path.join(os.environ["HOME"], "config")
 except:
        error = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, 
gtk.BUTTONS_CLOSE, "Make sure that Python-xdg is correctly installed if you 
need autostart handling.")
        response = error.run()
@@ -300,22 +304,32 @@
        return strous
 
 # Glade file used in all classes
-if os.path.isfile(os.path.dirname(sys.argv[0])+'/gdevilspie.glade'):
-       gladefile = os.path.dirname(sys.argv[0])+'/gdevilspie.glade'
-elif os.path.isfile(os.path.dirname(sys.argv[0]) + 
'/../share/gdevilspie/gdevilspie.glade'):
-       gladefile = 
os.path.dirname(sys.argv[0])+'/../share/gdevilspie/gdevilspie.glade'
-else:
-       gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, "Glade 
file not found, exiting.").run()
-       quit()
+for syspath in os.environ["PATH"].split(":"):
+       if os.path.isfile(os.path.dirname(syspath) + 
'/../share/gdevilspie/gdevilspie.glade'):
+               gladefile = 
os.path.dirname(syspath)+'/../share/gdevilspie/gdevilspie.glade'
+               break
+if "gladefile" not in globals():
+       if os.path.isfile(os.path.dirname(sys.argv[0])+'/gdevilspie.glade'):
+               gladefile = os.path.dirname(sys.argv[0])+'/gdevilspie.glade'
+       elif os.path.isfile(os.path.dirname(sys.argv[0]) + 
'/../share/gdevilspie/gdevilspie.glade'):
+               gladefile = 
os.path.dirname(sys.argv[0])+'/../share/gdevilspie/gdevilspie.glade'
+       else:
+               gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, 
gtk.BUTTONS_CLOSE, "Glade file not found, exiting.").run()
+               quit()
 
 
 # icon used
-if os.path.isfile(os.path.dirname(sys.argv[0])+'/gdevilspie.png'):
-       gdevilspie_icon = os.path.dirname(sys.argv[0])+'/gdevilspie.png'
-elif os.path.isfile(os.path.dirname(sys.argv[0]) + 
'/../share/gdevilspie/gdevilspie.png'):
-       gdevilspie_icon = 
os.path.dirname(sys.argv[0])+'/../share/gdevilspie/gdevilspie.png'
-else:
-       gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, "Icon 
file not found.").run()
+for syspath in os.environ["PATH"].split(":"):
+       if os.path.isfile(os.path.dirname(syspath) + 
'/../share/gdevilspie/gdevilspie.png'):
+               gdevilspie_icon = 
os.path.dirname(syspath)+'/../share/gdevilspie/gdevilspie.png'
+               break
+if "gdevilspie_icon" not in globals():
+       if os.path.isfile(os.path.dirname(sys.argv[0])+'/gdevilspie.png'):
+               gdevilspie_icon = os.path.dirname(sys.argv[0])+'/gdevilspie.png'
+       elif os.path.isfile(os.path.dirname(sys.argv[0]) + 
'/../share/gdevilspie/gdevilspie.png'):
+               gdevilspie_icon = 
os.path.dirname(sys.argv[0])+'/../share/gdevilspie/gdevilspie.png'
+       else:
+               gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, 
gtk.BUTTONS_CLOSE, "Icon file not found.").run()
 
 # Directory where we store .ds files
 dir = os.path.expanduser("~/.devilspie")
@@ -542,12 +556,12 @@
                if ( DISABLE_XDG == "True" ):
                                self.DaemonAutostart.set_sensitive(False)
                else:
-                               if 
(os.path.exists(xdg.DesktopEntry.xdg_config_home + 
"/autostart/devilspie.desktop")):
-                                       df = 
xdg.DesktopEntry.DesktopEntry(xdg.DesktopEntry.xdg_config_home + 
"/autostart/devilspie.desktop")
+                               if (os.path.exists(xdg_config_home + 
"/autostart/devilspie.desktop")):
+                                       df = 
xdg.DesktopEntry.DesktopEntry(xdg_config_home + "/autostart/devilspie.desktop")
                                        if (df.get('X-GNOME-Autostart-enabled') 
== 'true'):
                                                        
self.DaemonAutostart.set_active(True)
                                else:
-                                               df = 
xdg.DesktopEntry.DesktopEntry(xdg.DesktopEntry.xdg_config_home + 
"/autostart/devilspie.desktop")
+                                               df = 
xdg.DesktopEntry.DesktopEntry(xdg_config_home + "/autostart/devilspie.desktop")
                                                df.set('Name','Devilspie')
                                                df.set('Exec','devilspie')
                                                
df.set('X-GNOME-Autostart-enabled','false')
@@ -555,7 +569,7 @@
 
                                        
   def on_DaemonAutostart_toggled(self,widget):
-                       df = 
xdg.DesktopEntry.DesktopEntry(xdg.DesktopEntry.xdg_config_home + 
"/autostart/devilspie.desktop")
+                       df = xdg.DesktopEntry.DesktopEntry(xdg_config_home + 
"/autostart/devilspie.desktop")
                        if (widget.get_active()):
                                        
df.set('X-GNOME-Autostart-enabled','true')
                                        df.write()




Reply via email to