ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:23.02 GB of 70.42 GB (32.69%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ usr/ share/ pyshared/ landscape/ lib/ - drwxr-xr-x

Directory:
Viewing file:     bpickle_dbus.py (2.19 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"""
Different versions of the Python DBus bindings return different types
to represent integers, strings, lists, etc.  Older versions return
builtin Python types: C{int}, C{str}, C{list}, etc.  Newer versions
return DBus-specific wrappers: C{Int16}, C{String}, C{Array}, etc.
Failures occur when DBus types are used because bpickle doesn't know
that an C{Int16} is really an C{int} and that an C{Array} is really a
C{list}.

L{install} and L{uninstall} can install and remove extensions that
make bpickle work with DBus types.
"""

import dbus

from landscape.lib import bpickle


def install():
    """Install bpickle extensions for DBus types."""
    for type, function in get_dbus_types():
        bpickle.dumps_table[type] = function


def uninstall():
    """Uninstall bpickle extensions for DBus types."""
    for type, function in get_dbus_types():
        del bpickle.dumps_table[type]


def dumps_utf8string(obj):
    """
    Convert the specified L{dbus.types.UTF8String} to bpickle's
    representation for C{unicode} data.
    """
    return "u%s:%s" % (len(obj), obj)

def dumps_double(obj):
    """
    Convert a dbus.types.Double into a floating point representation.
    """
    return "f%r;" % float(obj)

def get_dbus_types():
    """
    Generator yields C{(type, bpickle_function)} for available DBus
    types.
    """
    for (type_name, function) in [("Boolean", bpickle.dumps_bool),
                                  ("Int16", bpickle.dumps_int),
                                  ("UInt16", bpickle.dumps_int),
                                  ("Int32", bpickle.dumps_int),
                                  ("UInt32", bpickle.dumps_int),
                                  ("Int64", bpickle.dumps_int),
                                  ("UInt64", bpickle.dumps_int),
                                  ("Double", dumps_double),
                                  ("Array", bpickle.dumps_list),
                                  ("Dictionary", bpickle.dumps_dict),
                                  ("String", bpickle.dumps_unicode),
                                  ("UTF8String", dumps_utf8string),]:
        type = getattr(dbus.types, type_name, None)
        if type is not None:
            yield type, function
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 1.1009 seconds