|
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 | : | 25.75 GB of 70.42 GB (36.57%) |
|
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,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
share/
pyshared/
gi/
overrides/
- drwxr-xr-x
|
Viewing file: __init__.py (2.22 KB) -rw-r--r--Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
import sys import types
from gi import _gobject
registry = None class _Registry(dict): def __setitem__(self, key, value): '''We do checks here to make sure only submodules of the override module are added. Key and value should be the same object and come from the gi.override module.
We add the override to the dict as "override_module.name". For instance if we were overriding Gtk.Button you would retrive it as such: registry['Gtk.Button'] ''' if not key == value: raise KeyError('You have tried to modify the registry. This should only be done by the override decorator')
info = getattr(value, '__info__') if info == None: raise KeyError('Can not override a type %s, which is not in a gobject introspection typelib' % value.__name__)
if not value.__module__.startswith('gi.overrides'): raise KeyError('You have tried to modify the registry outside of the overrides module. This is not allowed')
g_type = info.get_g_type() assert g_type != _gobject.TYPE_NONE if g_type != _gobject.TYPE_INVALID: g_type.pytype = value
# strip gi.overrides from module name module = value.__module__[13:] key = "%s.%s" % (module, value.__name__) super(_Registry, self).__setitem__(key, value)
def register(self, override_class): self[override_class] = override_class
class overridefunc(object): '''decorator for overriding a function''' def __init__(self, func): if not hasattr(func, '__info__'): raise TypeError("func must be an gi function") from ..importer import modules self.module = modules[func.__module__]._introspection_module
def __call__(self, func): def wrapper(*args, **kwargs): return func(*args, **kwargs) wrapper.__name__ = func.__name__ setattr(self.module, func.__name__, wrapper) return wrapper
registry = _Registry()
def override(type_): '''Decorator for registering an override''' if type(type_) == types.FunctionType: return overridefunc(type_) else: registry.register(type_) return type_
|