davemds pushed a commit to branch master.

http://git.enlightenment.org/misc/polkit-efl.git/commit/?id=64175658af1634fe335917c216c21fe1f82a63dd

commit 64175658af1634fe335917c216c21fe1f82a63dd
Author: Dave Andreoli <[email protected]>
Date:   Sun Jan 4 14:07:00 2015 +0100

    Update to work with new and old ecore_x
---
 polkit-efl-authentication-agent-1 | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/polkit-efl-authentication-agent-1 
b/polkit-efl-authentication-agent-1
index 5fc1f0b..3e435fe 100755
--- a/polkit-efl-authentication-agent-1
+++ b/polkit-efl-authentication-agent-1
@@ -48,12 +48,18 @@ elementary.init()
 
 USE_ECORE_X = False
 try:
-    import efl.ecore.x
+    import efl.ecore.x as ecore_x
+    USE_ECORE_X = True
 except ImportError:
-    pass
-else:
-    if efl.ecore.x.init():
+    try:
+        import efl.ecore_x as ecore_x
         USE_ECORE_X = True
+    except ImportError:
+        pass
+
+if USE_ECORE_X:
+    if not ecore_x.init():
+        USE_ECORE_X = False
 
 from efl.elementary.window import Window, ELM_WIN_DOCK
 from efl.elementary.button import Button
@@ -457,7 +463,7 @@ class AuthenticationDialog(Window):
             log.debug("Dialog now visible")
             if USE_ECORE_X:
                 xid = self.xwindow_xid
-                xwin = efl.ecore.x.Window_from_xid(xid)
+                xwin = ecore_x.Window_from_xid(xid)
                 if not xwin.keyboard_grab():
                     pass  # TODO: Cancel auth? Or just warn user
             self.activate()
@@ -465,7 +471,7 @@ class AuthenticationDialog(Window):
         def hide_done_cb(*args):
             log.debug("Dialog now hidden, deleting")
             if USE_ECORE_X:
-                efl.ecore.x.keyboard_ungrab()
+                ecore_x.keyboard_ungrab()
             self.hiding = False
             dlg = agent.dialogs.pop(cookie)
             dlg.delete()

-- 


Reply via email to