Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib/python2.7/site-packages/paste/util
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
paste
/
util
/
📁
..
📄
PySourceColor.py
(83.85 KB)
📄
PySourceColor.pyc
(54.31 KB)
📄
PySourceColor.pyo
(54.31 KB)
📄
UserDict24.py
(5.39 KB)
📄
UserDict24.pyc
(10.27 KB)
📄
UserDict24.pyo
(10.27 KB)
📄
__init__.py
(86 B)
📄
__init__.pyc
(257 B)
📄
__init__.pyo
(257 B)
📄
classinit.py
(1.81 KB)
📄
classinit.pyc
(1.89 KB)
📄
classinit.pyo
(1.89 KB)
📄
classinstance.py
(1.34 KB)
📄
classinstance.pyc
(2.27 KB)
📄
classinstance.pyo
(2.11 KB)
📄
converters.py
(863 B)
📄
converters.pyc
(1.15 KB)
📄
converters.pyo
(1.15 KB)
📄
dateinterval.py
(2.36 KB)
📄
dateinterval.pyc
(3.08 KB)
📄
dateinterval.pyo
(3.08 KB)
📄
datetimeutil.py
(10.91 KB)
📄
datetimeutil.pyc
(10.01 KB)
📄
datetimeutil.pyo
(10.01 KB)
📄
doctest24.py
(97.09 KB)
📄
doctest24.pyc
(82.42 KB)
📄
doctest24.pyo
(82.14 KB)
📄
filemixin.py
(1.4 KB)
📄
filemixin.pyc
(2.01 KB)
📄
filemixin.pyo
(2.01 KB)
📄
finddata.py
(3.75 KB)
📄
finddata.pyc
(2.89 KB)
📄
finddata.pyo
(2.89 KB)
📄
findpackage.py
(786 B)
📄
findpackage.pyc
(914 B)
📄
findpackage.pyo
(914 B)
📄
import_string.py
(3.04 KB)
📄
import_string.pyc
(3.27 KB)
📄
import_string.pyo
(3.27 KB)
📄
intset.py
(18.68 KB)
📄
intset.pyc
(19.07 KB)
📄
intset.pyo
(19.07 KB)
📄
ip4.py
(9.05 KB)
📄
ip4.pyc
(9.02 KB)
📄
ip4.pyo
(9.02 KB)
📄
killthread.py
(1.2 KB)
📄
killthread.pyc
(1.4 KB)
📄
killthread.pyo
(1.4 KB)
📁
looper
📄
looper.py.tmpta
(3.88 KB)
📄
mimeparse.py
(6.44 KB)
📄
mimeparse.pyc
(6.99 KB)
📄
mimeparse.pyo
(6.99 KB)
📄
multidict.py
(11.14 KB)
📄
multidict.pyc
(16.33 KB)
📄
multidict.pyo
(16.33 KB)
📄
quoting.py
(2.42 KB)
📄
quoting.pyc
(2.94 KB)
📄
quoting.pyo
(2.94 KB)
📄
scgiserver.py
(5.5 KB)
📄
scgiserver.pyc
(5.98 KB)
📄
scgiserver.pyo
(5.87 KB)
📄
string24.py
(16.35 KB)
📄
string24.pyc
(18.25 KB)
📄
string24.pyo
(18.25 KB)
📁
template
📄
template.py.tmpta
(23.73 KB)
📄
threadedprint.py
(8.02 KB)
📄
threadedprint.pyc
(10.15 KB)
📄
threadedprint.pyo
(8.84 KB)
📄
threadinglocal.py
(1.45 KB)
📄
threadinglocal.pyc
(2.01 KB)
📄
threadinglocal.pyo
(2.01 KB)
Editing: import_string.py
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ 'imports' a string -- converts a string to a Python object, importing any necessary modules and evaluating the expression. Everything before the : in an import expression is the module path; everything after is an expression to be evaluated in the namespace of that module. Alternately, if no : is present, then import the modules and get the attributes as necessary. Arbitrary expressions are not allowed in that case. """ def eval_import(s): """ Import a module, or import an object from a module. A module name like ``foo.bar:baz()`` can be used, where ``foo.bar`` is the module, and ``baz()`` is an expression evaluated in the context of that module. Note this is not safe on arbitrary strings because of the eval. """ if ':' not in s: return simple_import(s) module_name, expr = s.split(':', 1) module = import_module(module_name) obj = eval(expr, module.__dict__) return obj def simple_import(s): """ Import a module, or import an object from a module. A name like ``foo.bar.baz`` can be a module ``foo.bar.baz`` or a module ``foo.bar`` with an object ``baz`` in it, or a module ``foo`` with an object ``bar`` with an attribute ``baz``. """ parts = s.split('.') module = import_module(parts[0]) name = parts[0] parts = parts[1:] last_import_error = None while parts: name += '.' + parts[0] try: module = import_module(name) parts = parts[1:] except ImportError, e: last_import_error = e break obj = module while parts: try: obj = getattr(module, parts[0]) except AttributeError: raise ImportError( "Cannot find %s in module %r (stopped importing modules with error %s)" % (parts[0], module, last_import_error)) parts = parts[1:] return obj def import_module(s): """ Import a module. """ mod = __import__(s) parts = s.split('.') for part in parts[1:]: mod = getattr(mod, part) return mod def try_import_module(module_name): """ Imports a module, but catches import errors. Only catches errors when that module doesn't exist; if that module itself has an import error it will still get raised. Returns None if the module doesn't exist. """ try: return import_module(module_name) except ImportError, e: if not getattr(e, 'args', None): raise desc = e.args[0] if not desc.startswith('No module named '): raise desc = desc[len('No module named '):] # If you import foo.bar.baz, the bad import could be any # of foo.bar.baz, bar.baz, or baz; we'll test them all: parts = module_name.split('.') for i in range(len(parts)): if desc == '.'.join(parts[i:]): return None raise
Upload File
Create Folder