Author: jreidinger
Date: Tue Jul 1 16:22:03 2008
New Revision: 48726
URL: http://svn.opensuse.org/viewcvs/yast?rev=48726&view=rev
Log:
add policy kit bindings to python
Added:
branches/tmp/lslezak/workshop/core/polkit-check/AuthException.py
branches/tmp/lslezak/workshop/core/polkit-check/Makefile
branches/tmp/lslezak/workshop/core/polkit-check/polkitwrapper.py
Modified:
branches/tmp/lslezak/workshop/core/polkit-check/polkit.c
Added: branches/tmp/lslezak/workshop/core/polkit-check/AuthException.py
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/polkit-check/AuthException.py?rev=48726&view=auto
==============================================================================
--- branches/tmp/lslezak/workshop/core/polkit-check/AuthException.py (added)
+++ branches/tmp/lslezak/workshop/core/polkit-check/AuthException.py Tue Jul 1 16:22:03 2008
@@ -0,0 +1,23 @@
+import dbus
+
+class AuthRequiredException(dbus.exceptions.DBusException):
+ def __init__(self, service=''):
+ DBusException.__init__(self, "Authentification needed for : %s"%msg)
+
+ def __doc__():
+ print "exception which is throwed when user must authentificate before call dbus method."
+
+ __doc__ = staticmethod(__doc__)
+
+class AccessDenied(dbus.exceptions.DBusException):
+ def __init__(self, service=''):
+ DBusException.__init__(self, "Policykit denied access to service: %s"%msg)
+
+ def __doc__():
+ print "exception which is throwed when user cannot use this service."
+
+ __doc__ = staticmethod(__doc__)
+
+if __name__=="__main__":
+ AuthRequiredException.__doc__()
+ AccessDenied.__doc__()
Added: branches/tmp/lslezak/workshop/core/polkit-check/Makefile
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/polkit-check/Makefile?rev=48726&view=auto
==============================================================================
--- branches/tmp/lslezak/workshop/core/polkit-check/Makefile (added)
+++ branches/tmp/lslezak/workshop/core/polkit-check/Makefile Tue Jul 1 16:22:03 2008
@@ -0,0 +1,2 @@
+polkitbind.so: polkit.c
+ gcc -fPIC -L/lib64 -lpython2.5 -ldbus-1 -lpolkit -lpolkit-dbus -I/usr/include/python -I/usr/include/PolicyKit -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -shared -o polkitbind.so polkit.c
Modified: branches/tmp/lslezak/workshop/core/polkit-check/polkit.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/polkit-check/polkit.c?rev=48726&r1=48725&r2=48726&view=diff
==============================================================================
--- branches/tmp/lslezak/workshop/core/polkit-check/polkit.c (original)
+++ branches/tmp/lslezak/workshop/core/polkit-check/polkit.c Tue Jul 1 16:22:03 2008
@@ -9,8 +9,12 @@
#include