p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.216.202
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/python-slip-0.4.0/dbus/example/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /usr/share/doc/python-slip-0.4.0/dbus/example/example-conf-client.py
#!/usr/bin/python
# -*- coding: utf-8 -*-

import dbus

# ## FIND THE ACTUAL EXAMPLE CODE BELOW...

# try to find the module in the unpacked source tree

import sys
import os.path
import import_marker

# try to find the slip.dbus module

import imp

modfile = import_marker.__file__
path = os.path.dirname(modfile)
found = False
oldsyspath = sys.path
while not found and path and path != "/":
    path = os.path.abspath(os.path.join(path, os.path.pardir))
    try:
        slipmod = imp.find_module("slip", [path] + sys.path)
        if slipmod[1].startswith(path + "/"):
            found = True
            sys.path.insert(0, path)
            import slip.dbus.service
    except ImportError:
        pass

if not found:

    # fall back to system paths

    sys.path = oldsyspath
    import slip.dbus.service

# ## ...BELOW HERE:

from slip.dbus import polkit


class DBusProxy(object):

    def __init__(self):
        self.bus = dbus.SessionBus()
        self.dbus_object = \
            self.bus.get_object("org.fedoraproject.slip.example.mechanism",
                                "/org/fedoraproject/slip/example/object")

    @polkit.enable_proxy
    def read(self):
        return self.dbus_object.read(dbus_interface="org.fedoraproject.slip.example.mechanism")

    @polkit.enable_proxy
    def write(self, config_data):
        return self.dbus_object.write(config_data,
                                      dbus_interface="org.fedoraproject.slip.example.mechanism")


example_object = DBusProxy()

# "org.fedoraproject.slip.example.mechanism", "/org/fedoraproject/slip/example/object")

config_data = example_object.read()

print "read config_data successfully:"
print config_data
print
print

print "attempting to write config data"

example_object.write(config_data + """

And a second more.""")

print "successfully wrote config data"
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
December 20 2023 04:36:11
0 / 0
0755
Makefile
1.426 KB
March 08 2013 10:55:58
0 / 0
0644
README
0.995 KB
March 08 2013 10:55:58
0 / 0
0644
example-conf-client.py
1.81 KB
March 08 2013 10:55:58
0 / 0
0644
example-conf-mechanism.py
2.295 KB
March 08 2013 10:55:58
0 / 0
0644
import_marker.py
0 KB
March 08 2013 10:55:58
0 / 0
0644
org.fedoraproject.slip.example.mechanism.conf
0.515 KB
March 08 2013 10:55:58
0 / 0
0644
org.fedoraproject.slip.example.mechanism.service
0.119 KB
March 08 2013 10:55:58
0 / 0
0644
org.fedoraproject.slip.example.policy
0.94 KB
March 08 2013 10:55:58
0 / 0
0644