Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
aptdaemon /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
worker
[ DIR ]
drwxr-xr-x
client.py
73.34
KB
-rw-r--r--
config.py
9
KB
-rw-r--r--
console.py
29.89
KB
-rw-r--r--
core.py
90.84
KB
-rw-r--r--
crash.py
2.74
KB
-rw-r--r--
debconf.py
6.24
KB
-rw-r--r--
enums.py
32.34
KB
-rw-r--r--
errors.py
7.29
KB
-rw-r--r--
gtk3widgets.py
47.25
KB
-rw-r--r--
__init__.py
1.14
KB
-rw-r--r--
lock.py
5.9
KB
-rw-r--r--
logger.py
2.3
KB
-rw-r--r--
loop.py
1.07
KB
-rw-r--r--
networking.py
9.7
KB
-rw-r--r--
policykit1.py
6.98
KB
-rw-r--r--
progress.py
33.4
KB
-rw-r--r--
utils.py
3.79
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : utils.py
"""Module with little helper functions and classes: deprecated - decorator to emit a warning if a depreacted function is used """ # Copyright (C) 2008-2009 Sebastian Heinlein <sevel@glatzor.de> # # Licensed under the GNU General Public License Version 2 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. __author__ = "Sebastian Heinlein <devel@glatzor.de>" __all__ = ("deprecated", "IsoCodes") import os import sys import contextlib import gettext import functools import warnings from xml.etree import ElementTree if sys.version >= '3': _gettext_method = "gettext" else: _gettext_method = "ugettext" def deprecated(func): """This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used. Taken from http://wiki.python.org/moin/PythonDecoratorLibrary #GeneratingDeprecationWarnings """ @functools.wraps(func) def new_func(*args, **kwargs): warnings.warn_explicit( "Call to deprecated function %(funcname)s." % { 'funcname': func.__name__, }, category=DeprecationWarning, filename=func.__code__.co_filename, lineno=func.__code__.co_firstlineno + 1 ) return func(*args, **kwargs) return new_func @contextlib.contextmanager def set_euid_egid(uid, gid): # no need to drop privs if os.getuid() != 0 and os.getgid() != 0: yield return # temporary drop privs os.setegid(gid) old_groups = os.getgroups() os.setgroups([gid]) os.seteuid(uid) try: yield finally: os.seteuid(os.getuid()) os.setegid(os.getgid()) os.setgroups(old_groups) class IsoCodes(object): """Provides access to the iso-codes language, script and country database. """ def __init__(self, norm, tag, fallback_tag=None): filename = "/usr/share/xml/iso-codes/%s.xml" % norm et = ElementTree.ElementTree(file=filename) self._dict = {} self.norm = norm for element in list(et.iter()): iso_code = element.get(tag) if not iso_code and fallback_tag: iso_code = element.get(fallback_tag) if iso_code: self._dict[iso_code] = element.get("name") def get_localised_name(self, value, locale): try: name = self._dict[value] except KeyError: return None trans = gettext.translation(domain=self.norm, fallback=True, languages=[locale]) return getattr(trans, _gettext_method)(name) def get_name(self, value): try: return self._dict[value] except KeyError: return None def split_package_id(package): """Return the name, the version number and the release of the specified package.""" if "=" in package: name, version = package.split("=", 1) release = None elif "/" in package: name, release = package.split("/", 1) version = None else: name = package version = release = None return name, version, release # vim:ts=4:sw=4:et
Close