Server IP : 127.0.0.2 / Your IP : 3.144.82.191 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,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,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.7/dist-packages/chameleon/ |
Upload File : |
import os import logging log = logging.getLogger('chameleon.config') environment = dict( (k[10:], v) for (k, v) in ( ((j.lower(), x) for (j, x) in os.environ.items())) if k.startswith('chameleon_') ) # Define which values are read as true TRUE = ('y', 'yes', 't', 'true', 'on', '1') # If eager parsing is enabled, templates are parsed upon # instantiation, rather than when first called upon; this mode is # useful for verifying validity of templates across a project EAGER_PARSING = environment.pop('eager', 'false') EAGER_PARSING = EAGER_PARSING.lower() in TRUE # Debug mode is mostly useful for debugging the template engine # itself. When enabled, generated source code is written to disk to # ease step-debugging and some log levels are lowered to increase # output. Also, the generated source code is available in the # ``source`` attribute of the template instance if compilation # succeeded. DEBUG_MODE = environment.pop('debug', 'false') DEBUG_MODE = DEBUG_MODE.lower() in TRUE # If a cache directory is specified, template source code will be # persisted on disk and reloaded between sessions path = environment.pop('cache', None) if path is not None: CACHE_DIRECTORY = os.path.abspath(path) if not os.path.exists(CACHE_DIRECTORY): raise ValueError( "Cache directory does not exist: %s." % CACHE_DIRECTORY ) log.info("directory cache: %s." % CACHE_DIRECTORY) else: CACHE_DIRECTORY = None # When auto-reload is enabled, templates are reloaded on file change. AUTO_RELOAD = environment.pop('reload', 'false') AUTO_RELOAD = AUTO_RELOAD.lower() in TRUE for key in environment: log.warning( "unknown environment variable set: \"CHAMELEON_%s\"." % key.upper() ) # This is the slice length of the expression displayed in the # formatted exception string SOURCE_EXPRESSION_MARKER_LENGTH = 60