schuellerf / gdevilspie

Automatically exported from code.google.com/p/gdevilspie
GNU General Public License v3.0
0 stars 1 forks source link

gdevilspie crashes on startup #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run gdevilspie
2.
3.

What is the expected output? What do you see instead?
I get:
Traceback (most recent call last):
  File "/usr/bin/gdevilspie", line 893, in <module>
    MainWindow = RulesListWindow()
  File "/usr/bin/gdevilspie", line 374, in __init__
    self.UpdateAutostartStatus()
  File "/usr/bin/gdevilspie", line 545, in UpdateAutostartStatus
    if (os.path.exists(xdg.DesktopEntry.xdg_config_home + "/autostart/devilspie.desktop")):
AttributeError: 'module' object has no attribute 'xdg_config_home'

What version of the product are you using? On what operating system?
gdevilspie 0.5
Ubuntu 14.04

Please provide any additional information below.

Original issue reported on code.google.com by steve.ke...@gmail.com on 17 May 2014 at 7:29

GoogleCodeExporter commented 8 years ago
Hi,

here is a patch:

--- gdevilspie.0    2014-05-29 15:22:19.140058066 +0200
+++ gdevilspie.new  2014-05-29 15:20:35.668053528 +0200
@@ -47,13 +47,16 @@

 DISABLE_XDG=""
 try:
-    import xdg.DesktopEntry
+    import xdg.BaseDirectory
 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()
    error.destroy()
    DISABLE_XDG="True"

+#Please increse this part
+import xdg.DesktopEntry
+
 import gettext
 _ = gettext.gettext
 PACKAGE = "gdevilspie"
@@ -542,12 +545,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.BaseDirectory.xdg_config_home + 
"/autostart/devilspie.desktop")):
+                   df = xdg.DesktopEntry.DesktopEntry(xdg.BaseDirectory.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.BaseDirectory.xdg_config_home + 
"/autostart/devilspie.desktop")
                        df.set('Name','Devilspie')
                        df.set('Exec','devilspie')
                        df.set('X-GNOME-Autostart-enabled','false')
@@ -555,7 +558,7 @@

   def on_DaemonAutostart_toggled(self,widget):
-           df = xdg.DesktopEntry.DesktopEntry(xdg.DesktopEntry.xdg_config_home + 
"/autostart/devilspie.desktop")
+           df = xdg.DesktopEntry.DesktopEntry(xdg.BaseDirectory.xdg_config_home + 
"/autostart/devilspie.desktop")
            if (widget.get_active()):
                    df.set('X-GNOME-Autostart-enabled','true')
                    df.write()

Original comment by tuxmoura...@gmail.com on 29 May 2014 at 1:28

GoogleCodeExporter commented 8 years ago
I just saw the patch on issue 20, same as mine.

Original comment by tuxmoura...@gmail.com on 29 May 2014 at 1:32