[25461] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r24999 - trunk/debathena/config/gdm-config/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Wed Mar 2 19:52:58 2011

Date: Wed, 2 Mar 2011 19:52:52 -0500
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201103030052.p230qqSh003425@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2011-03-02 19:52:52 -0500 (Wed, 02 Mar 2011)
New Revision: 24999

Modified:
   trunk/debathena/config/gdm-config/debian/debathena-nologin-monitor
Log:
Use the poorly-documented constants

Modified: trunk/debathena/config/gdm-config/debian/debathena-nologin-monitor
===================================================================
--- trunk/debathena/config/gdm-config/debian/debathena-nologin-monitor	2011-03-02 21:57:07 UTC (rev 24998)
+++ trunk/debathena/config/gdm-config/debian/debathena-nologin-monitor	2011-03-03 00:52:52 UTC (rev 24999)
@@ -45,20 +45,15 @@
         except OSError:
             # Assume cluster
             metapackage = 'debathena-cluster'
-        if metapackage == 'debathena-cluster':
+        if metapackage == 'debathena-workstation':
             self.gfile = gio.File("/var/run/athena-nologin")
             self.monitor = self.gfile.monitor_file(gio.FILE_MONITOR_NONE, None)
             self.monitor.connect("changed", self.directory_changed)
 
     def directory_changed(self, monitor, file1, file2, evt_type):
-        # type(evt_type) is <class 'gio._gio.FileMonitorEvent'>
-        # Value is something like:
-        #     <enum G_FILE_MONITOR_EVENT_CREATED of type GFileMonitorEvent>
-        # However, those constants aren't available in Python, unless I'm missing something
-        # So, we do this the stupid way:
-        if str(evt_type) == "<enum G_FILE_MONITOR_EVENT_CREATED of type GFileMonitorEvent>":
+        if evt_type == gio.FILE_MONITOR_EVENT_CREATED:
             self.window.show_all()
-        if str(evt_type) == "<enum G_FILE_MONITOR_EVENT_DELETED of type GFileMonitorEvent>":
+        if evt_type == gio.FILE_MONITOR_EVENT_DELETED:
             self.window.hide()
 
    # Connect to the session manager, and register our client.


home help back first fref pref prev next nref lref last post