| Server IP : 142.11.234.102 / Your IP : 216.73.217.78 Web Server : Apache System : Linux dal-shared-66.hostwindsdns.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64 User : krnuyqrm ( 1183) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/lib64/python2.7/site-packages/Cheetah/ |
Upload File : |
import os
import sys
import types
# Compatability definitions (inspired by six)
PY2 = sys.version_info[0] < 3
if PY2:
# disable flake8 checks on python 3
string_type = basestring # noqa
unicode = unicode # noqa
else:
string_type = str
unicode = str
try:
RecursionError = RecursionError
except NameError: # Python 2.7, 3.4
RecursionError = RuntimeError
if PY2:
import imp
def load_module_from_file(base_name, module_name, filename):
fp, pathname, description = imp.find_module(
base_name, [os.path.dirname(filename)])
try:
module = imp.load_module(module_name, fp, pathname, description)
finally:
fp.close()
return module
new_module = imp.new_module
get_suffixes = imp.get_suffixes
else:
import importlib.machinery
import importlib.util
def load_module_from_file(base_name, module_name, filename):
specs = importlib.util.spec_from_file_location(module_name, filename)
return specs.loader.load_module()
new_module = types.ModuleType
def get_suffixes():
extensions = [
(s, 'rb', 3) for s in importlib.machinery.EXTENSION_SUFFIXES
]
source = [
(s, 'rU', 1) for s in importlib.machinery.SOURCE_SUFFIXES
]
bytecode = [
(s, 'rb', 2) for s in importlib.machinery.BYTECODE_SUFFIXES
]
return extensions + source + bytecode