Author: Matti Picus <[email protected]> Branch: chameleon Changeset: r389:62161d638d82 Date: 2019-12-31 17:05 +0200 http://bitbucket.org/pypy/benchmarks/changeset/62161d638d82/
Log: update chameleon to latest GIT master diff too long, truncating to 2000 out of 9806 lines diff --git a/lib/chameleon/.git/HEAD b/lib/chameleon/.git/HEAD new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/HEAD @@ -0,0 +1,1 @@ +ref: refs/heads/master diff --git a/lib/chameleon/.git/config b/lib/chameleon/.git/config new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/config @@ -0,0 +1,11 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = https://github.com/malthe/chameleon.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/lib/chameleon/.git/description b/lib/chameleon/.git/description new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/description @@ -0,0 +1,1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/lib/chameleon/.git/hooks/applypatch-msg.sample b/lib/chameleon/.git/hooks/applypatch-msg.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/lib/chameleon/.git/hooks/commit-msg.sample b/lib/chameleon/.git/hooks/commit-msg.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/lib/chameleon/.git/hooks/fsmonitor-watchman.sample b/lib/chameleon/.git/hooks/fsmonitor-watchman.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/fsmonitor-watchman.sample @@ -0,0 +1,114 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 1) and a time in nanoseconds +# formatted as a string and outputs to stdout all files that have been +# modified since the given time. Paths must be relative to the root of +# the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $time) = @ARGV; + +# Check the hook interface version + +if ($version == 1) { + # convert nanoseconds to seconds + $time = int $time / 1000000000; +} else { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree; +if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $git_work_tree = Win32::GetCwd(); + $git_work_tree =~ tr/\\/\//; +} else { + require Cwd; + $git_work_tree = Cwd::cwd(); +} + +my $retry = 1; + +launch_watchman(); + +sub launch_watchman { + + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $time but were not transient (ie created after + # $time but no longer exist). + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + # + # The category of transient files that we want to ignore will have a + # creation clock (cclock) newer than $time_t value and will also not + # currently exist. + + my $query = <<" END"; + ["query", "$git_work_tree", { + "since": $time, + "fields": ["name"], + "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] + }] + END + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; <CHLD_OUT>}; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + my $json_pkg; + eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; + } or do { + require JSON::PP; + $json_pkg = "JSON::PP"; + }; + + my $o = $json_pkg->new->utf8->decode($response); + + if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { + print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; + $retry--; + qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + print "/\0"; + eval { launch_watchman() }; + exit 0; + } + + die "Watchman: $o->{error}.\n" . + "Falling back to scanning...\n" if $o->{error}; + + binmode STDOUT, ":utf8"; + local $, = "\0"; + print @{$o->{files}}; +} diff --git a/lib/chameleon/.git/hooks/post-update.sample b/lib/chameleon/.git/hooks/post-update.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/lib/chameleon/.git/hooks/pre-applypatch.sample b/lib/chameleon/.git/hooks/pre-applypatch.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/lib/chameleon/.git/hooks/pre-commit.sample b/lib/chameleon/.git/hooks/pre-commit.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/lib/chameleon/.git/hooks/pre-push.sample b/lib/chameleon/.git/hooks/pre-push.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# <local ref> <local sha1> <remote ref> <remote sha1> +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/lib/chameleon/.git/hooks/pre-rebase.sample b/lib/chameleon/.git/hooks/pre-rebase.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/lib/chameleon/.git/hooks/pre-receive.sample b/lib/chameleon/.git/hooks/pre-receive.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/lib/chameleon/.git/hooks/prepare-commit-msg.sample b/lib/chameleon/.git/hooks/prepare-commit-msg.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/lib/chameleon/.git/hooks/update.sample b/lib/chameleon/.git/hooks/update.sample new file mode 100755 --- /dev/null +++ b/lib/chameleon/.git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 <ref> <oldrev> <newrev>)" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 <ref> <oldrev> <newrev>" >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/lib/chameleon/.git/index b/lib/chameleon/.git/index new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b5bf8295eb5fd92d033d4c208691b21945fbb726 GIT binary patch [cut] diff --git a/lib/chameleon/.git/info/exclude b/lib/chameleon/.git/info/exclude new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/lib/chameleon/.git/logs/HEAD b/lib/chameleon/.git/logs/HEAD new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/logs/HEAD @@ -0,0 +1,1 @@ +0000000000000000000000000000000000000000 559ab649c979fa77467982b5feb254b665f92950 mattip <[email protected]> 1577804602 +0200 clone: from https://github.com/malthe/chameleon.git diff --git a/lib/chameleon/.git/logs/refs/heads/master b/lib/chameleon/.git/logs/refs/heads/master new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/logs/refs/heads/master @@ -0,0 +1,1 @@ +0000000000000000000000000000000000000000 559ab649c979fa77467982b5feb254b665f92950 mattip <[email protected]> 1577804602 +0200 clone: from https://github.com/malthe/chameleon.git diff --git a/lib/chameleon/.git/logs/refs/remotes/origin/HEAD b/lib/chameleon/.git/logs/refs/remotes/origin/HEAD new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/logs/refs/remotes/origin/HEAD @@ -0,0 +1,1 @@ +0000000000000000000000000000000000000000 559ab649c979fa77467982b5feb254b665f92950 mattip <[email protected]> 1577804602 +0200 clone: from https://github.com/malthe/chameleon.git diff --git a/lib/chameleon/.git/objects/pack/pack-3a33d60ede72fabfdc2df4a039559e5f5740948c.idx b/lib/chameleon/.git/objects/pack/pack-3a33d60ede72fabfdc2df4a039559e5f5740948c.idx new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1a05e34e4585a9277314274e95ec73ecc917f56e GIT binary patch [cut] diff --git a/lib/chameleon/.git/objects/pack/pack-3a33d60ede72fabfdc2df4a039559e5f5740948c.pack b/lib/chameleon/.git/objects/pack/pack-3a33d60ede72fabfdc2df4a039559e5f5740948c.pack new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8a18da6ea0db9d7801f12d265d6eb77638db72b5 GIT binary patch [cut] diff --git a/lib/chameleon/.git/packed-refs b/lib/chameleon/.git/packed-refs new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/packed-refs @@ -0,0 +1,169 @@ +# pack-refs with: peeled fully-peeled sorted +95c31f9ac136722f5ba0e16a6104e5180bd75fe4 refs/remotes/origin/1.3 +838fab8085ff4e4f741c27dec3c153b84f392bd9 refs/remotes/origin/allow-html5-data-attribute-as-contrl-prefix +aaaac4ee2aa20697740e26f9111490576f299ea0 refs/remotes/origin/fix-dollar-escape-at-end-of-string +559ab649c979fa77467982b5feb254b665f92950 refs/remotes/origin/master +9e299f4b4af7e38c3b0d4cec081d3f7adcf0bc66 refs/tags/2.0 +^440246a268791d8260bf95a630f194bc25bd2b20 +cd097e38679c0f872f3564803f81538480ea94aa refs/tags/2.0-rc1 +^f8626f626b5fc65cc8b2c3aff6b4bb940ad91a5f +4bfda45916d94ac665d96a027b3108fc6b7a1ac7 refs/tags/2.0-rc10 +^a21f6bde03d0a4a79dd8ac1b2a7ae05a3fe21e08 +313ab83b406fab82f796d72bc7814a5859bf7af7 refs/tags/2.0-rc11 +^1a91be02e4c9aa435c51da72f7874a6e24051617 +fb8c2fad2e62002904bf80f038fd1311abe6d54a refs/tags/2.0-rc12 +^f956817fa4a060ea694562fc8cdbfeb40eae04c5 +a40685bee1ad15d7aa8275da47ed6886fb098fe3 refs/tags/2.0-rc13 +^bc8d121c941fea419465941fef6805899e6861a4 +60004328a6e1d17927a00e346646205eb881e729 refs/tags/2.0-rc14 +^9fbb2ab5a923ad27bcad6b445575c2d018402862 +9668391f2e4e699d838f7ccd5aa804b113102445 refs/tags/2.0-rc2 +^3737f9850741531056c460d8acf572e8f035c833 +98f0791d11cadd3e423d45d6d65d15e100dcaa9f refs/tags/2.0-rc3 +^9c8adee93480a77f063a2a8afb1c7317e6a76a96 +b487d7277abf0b0fb0fad0514f7b64d1820f5486 refs/tags/2.0-rc4 +^27c33b96788a28190348191eead1a1fa7c9c17d9 +0c2d2709f2247d1424045014af61033f85f533c7 refs/tags/2.0-rc5 +^bdc4389ef54d34b9705345f46d28100fe27ec14d +713f3673fb605449b06f12f08f03893f1f9ec405 refs/tags/2.0-rc6 +^d120c5ed56e1e5f13b0b9a2ed5c42c2e0d6328f7 +913f2ee0a1c0b18e7c1381038266dfd0428a705a refs/tags/2.0-rc7 +^d03f4762259074bc50c138a8b4d26092f2285d9c +57f261ec57b9175491e2a8c4764c3c6d261a5c6e refs/tags/2.0-rc8 +^050c0c6335c0e07b9bfa3a6804effd7a6b6deb03 +a30c384497d00ab35a39a5d35f8b99487cc1ec94 refs/tags/2.0-rc9 +^4afe30ade113ad3b06a9ce6990469f00cf6e954a +116463e81292bd9df39a0452057188778d5d293b refs/tags/2.0.1 +^ab254f3a4b0bc4af6e180c276bd8b6e337db61c9 +8ee930bdbaa939da061719ccdfa13a3f46e36807 refs/tags/2.0.2 +^9c5bb7476c9225f95cc5ab5f6ebaf000926977ec +5d1821b82d086842ded6ba920a9ce9103d3b4777 refs/tags/2.1 +^b17b2dc1164564f5dc4d910ba9d82d8bd619d252 +0eed0c29636ad4e718f4e4ec56b669205fca1070 refs/tags/2.1.1 +^164898adb18b97fbfcb29b8c507d0233828f3181 +269ff35b2aa02f6d9dda6faae9eab7ccc2574f76 refs/tags/2.10 +^bf798ce808f618a1e0a337dbf0eba71e4d240104 +8f38725b65c99821d20c6336da8b692a9b6163ad refs/tags/2.11 +^b3d50ac45ef36b12aaa3e14083ee60a2dc2301db +ce7de4938759d847ac0ec208123941e16728e838 refs/tags/2.12 +^6d3ab682e9177cb14326806f4d7454dae3b55606 +e8472645d1be24d4e9a7a7a86826dfb4b212badc refs/tags/2.13 +^3355057b70021afc454cc2317f7db5f1b2347e3b +d2f66bddee3d7cb7c9fb002d2a811178eb79f5b2 refs/tags/2.13-1 +^b6c2a243d85eacfd4daca692142d5068a7dcf35b +0f753f1df3b3164ecc5c81e65f244ed5724dfd95 refs/tags/2.14 +^b2747539e76e5e35c2c5d2c5dfceb9abd2713817 +c54597c5a409199be6ec1bf63f186eeefbc03b30 refs/tags/2.15 +^3ae95a3d6d00dfa91e9789f840b7968293db711a +b11abb37d2760a4024f91d3b3973106a251fd60f refs/tags/2.16 +^7652686e721b8439be2b3d1357905cb09da203bf +a67ed8cf70c5e77c5b17d6cd37cf616ee92e571f refs/tags/2.17 +^64dc123da27d2c93c2f332ee66563190356a78c3 +4bb69fd43d046f903d522f319404ea7c2ce4c6fd refs/tags/2.18 +^da76c633c8236fba4010e1aabde3bf812ac5417f +44289cfe93890e903e2a3ed023474106603b6a1b refs/tags/2.19 +^91d356b25be0875fa2b72278a8a7a2c237280f0c +5f2e933460d8e7eb0249b860c1f21d4f75db9570 refs/tags/2.2 +^a1c159cb28fcecd89f865eecd411343fd3198923 +55fa99c883bf82ffb505a41eb32616d3f6018aed refs/tags/2.20 +^2473195f4f5326d6349bc64a9aaa46003f343cc3 +00c9f050ca19fd2ecbd366669ae134a910a6d24d refs/tags/2.21 +^8fdcd55dca30ddfbd0bb16b7636be93d0ad40861 +04a6e480598cfe5a6faa1109c7802ce2e7c0be5d refs/tags/2.22 +^07b1566d1eab0c333727a0371f66da0f875c25d2 +eadedf132ef90d984f4da5e83ed08509ffa2d475 refs/tags/2.23 +^65ad56d82c0716a59987475125bdaa676478d3fb +6a231e14c07ea5232d975b47c9d06fbc6df44e20 refs/tags/2.24 +^7326b8a13393a89ab8a6428f57e0d67bd6bc3e9b +f211ce07a4d1c18946a4f5b241708d6089438377 refs/tags/2.25 +^c1f4159d28dd00e08c0e1217c39ec9f01c1a1776 +d6cbcb6b739901a48b5c8a9c9ce8802c9425709d refs/tags/2.3 +^84016ef8323c4ce03517f24771b4c08466d53e40 +dcc96e9b0a02d6e4f67bc4a76ab273df569633e1 refs/tags/2.3.1 +^89b009f925c68f84a0ff62360c371b7d7bd869a1 +922804fdea269b7ed1879d0f908d356163485c28 refs/tags/2.3.2 +^11783a217dd322ab8c023cec192104d23cf634fa +006aa646b13f6bc663acf50d7bbca5709af23de9 refs/tags/2.3.3 +^f445d340f41dc2069034fa0fccbe1ecbff382631 +2a985fcb595964c791198e9b3217fba0976402dd refs/tags/2.3.4 +^607bee18c06b7e7898a8181fd3578d4fe3e89fab +650c0f8f879e97480515c8f6551e45d7a5199b51 refs/tags/2.3.5 +^9b087438795473ddabf878e84b67945a99d0f714 +2da784b626bc196da4b1c445683bfaccd9e7a942 refs/tags/2.3.6 +^af6684237baee47c3cc760d99fba3c3a4726e713 +f701ff06c05925a6076a1271bb8f16d4e7eafaa5 refs/tags/2.3.7 +^702184ea0ea4c986100c2381497e90c67d881710 +c0e625d8f65644e9bdf124bda3d8960bb84e75cc refs/tags/2.3.8 +^f007a40a77d41e952965c68fd97d3f992f1c653b +a072aa7578816583a799f59444a1eccc08e63159 refs/tags/2.4.0 +^789548751193158bd13b089053fa73afc6c5e487 +5fe744a6df9ac5b8cd6326059021232f738c78bc refs/tags/2.4.1 +^1d73a1d47c97b38e13380c8dcc2f57d55939fab0 +7856dee6dee2e462b53833388d49638de88b4960 refs/tags/2.4.2 +^943d4c61fb21c4fa48dd760fe9ff5eac6266a147 +0112d33d4a5593057fd94ee59b4050b31534a143 refs/tags/2.4.3 +^3c86ee1e6752c308a346bec17588f2fbb26251b9 +42ac6bd0f92c04d608dc5b8f86ec99672374ffc7 refs/tags/2.4.4 +^1ecbc7f6c30a0b29e1bcd6a48a985683922305d3 +ba9c751b3eee765ea4359c6ad1a75be98e2bac1d refs/tags/2.4.5 +^98363a1db489b11b4ec33dec61fe75fa478c6122 +4d87f43af187bbd4bfa0fb1bdd801145a23a3628 refs/tags/2.4.6 +^55b5fe905ea07694acd15c309cebd78dd2ddba41 +8500d255f022736710f9b7588caad3bc163d22d3 refs/tags/2.5.0 +^58fb4f80d3bac730ae3c664bdf83dcbad497445e +1a29ad86573fc95e2dbf2e23df75fb7259517558 refs/tags/2.5.1 +^619bf1fea11f61d0126d261fb53b1a121302ff46 +9abbf0c285ee9667ad66ca6472fb23be0634ca2e refs/tags/2.5.2 +^9af921665e9f8e2276c132728742a6c504ecd6ca +4c8a633bd10857e4db104a58b2c42e434b9243a4 refs/tags/2.5.3 +^8eca09d543f43c5edb41c5c25e6cd9bbe93992ed +c40073ae6924fd2fecbdcd092e914ba7bea09473 refs/tags/2.6.0 +^3386c26a4d9169815ad19b4cbe7fb04e6d3fd554 +911df611ac669112a462e52b33ed2f3eef07f383 refs/tags/2.6.1 +^bf34fd136237c5d724093758e9b418e61c47f806 +e9d6d40f7d70fea8d28aac339c4f97ea2f09ab90 refs/tags/2.6.2 +^dd6415f33a2efc62c8f1860740606d60d2d0f7ef +408074c6fc6c7df06499bb11a9f1735f54a48192 refs/tags/2.7.0 +^73723372a5a25c466425328a28a2cceb11e6104b +6995b1438841847d95bd616bdd533cdaa99a533e refs/tags/2.7.1 +^7074855da37eaedf4523b561d8373cefbf8e1270 +96c87855a70e0f01fa65c3ddaa83a3aadb77bf03 refs/tags/2.7.2 +^7147545d9d867522b6ad1580d6ecfb3f0d68c8f0 +608b6095732c0553ab607cbcd5d2289810aea4e7 refs/tags/2.7.3 +^e5a386587cbbe83e1f9a18130b0da9998774a244 +77a54c30688ec7157deef6dab2587d9056cf5ea1 refs/tags/2.7.4 +^631e3131a94468436dc8f581a068ece46e119be5 +c90af00b69cd9420da70360f8dfe85a8b55780b6 refs/tags/2.8.0 +^0d5e6ee1d24314d369cb952d814b9e7dfcdde40f +66905936b0435a1f14af92a513c700dc33e9af82 refs/tags/2.8.1 +^0c2a4497c7da50efcb54963c18492c8057ee9748 +e61b693773b2184435eea6c0636c022e792fc08d refs/tags/2.8.2 +^d3cb822dcf0983a55c9edcf547e72bf698a8e63b +a937d7e7230803804ec9fbda87751864c166585b refs/tags/2.8.3 +^26d5ac892a141c238f87c8e71b455e0e1d529d19 +51ae8757aee1dc54bab1ce985911837332c4019e refs/tags/2.8.4 +^f625708f40a1b0f7ab8fed561cc5a68090065645 +9f80e9a9133d61863fce9df7df4357fd8b9ab772 refs/tags/2.8.5 +^58ef63dfbd4d1b1fc874f10e16a7f30c2fe63555 +b22aee05cc2b9567cb1fac82c1f8dedb27a61a98 refs/tags/2.9.0 +^76bebbb82a8eb002c80143bfaa2ac57a0f2c388b +a76fd09520f58b5ca43d905b17548f55ea36dca7 refs/tags/2.9.1 +^bbfce8555f4af8c0e220efcc66805f66e10ff544 +659e060549b56a8d10d5e4230e550a875ba70ffa refs/tags/2.9.2 +^fe730e478b0f87e90bc38c2de9270849fda9c384 +f28a4ee980fb409d710104bb1d28ea26ecf1ca23 refs/tags/3.0 +^c47ea64b8e167050d017c913d4d4a28916d4ad8d +3a317c05505b9541362441d73dae6b9f50f59d92 refs/tags/3.1 +^12b3b6a44fa8a5b49ad0d63e0f21e59c75789a37 +24c360de8005e8b626a797689a5d42463c3730e3 refs/tags/3.2 +^78628c5027430c8d7d437845588bcc02aacfd1fc +98374bb6b982f53051975c02ae56dad048004914 refs/tags/3.3 +ebebf78e3feced96168ea927f08e908a838eb580 refs/tags/3.4 +eddaa33ac0428ae81bd9b163bed02f79a3a78116 refs/tags/3.5 +^9c1d8003f5409d4de6bf6d38446491383c6f2d5f +87a6dc321695c314bacdadc308a7f09d5c0898cc refs/tags/3.6 +^7da66acfa1b8a3479e800747f3f8ad6e469d24f9 +f91105a48715b8fffefc01cf632a4daad4c50b36 refs/tags/3.6.1 +^6d515df8e03051268df2cb635d415fa5b7f012c2 +aa9d5d1cd20ededeeae963532fe7bf5a03256517 refs/tags/3.6.2 +^f540da3de0033c0dac9853668ea193c333db49ac diff --git a/lib/chameleon/.git/refs/heads/master b/lib/chameleon/.git/refs/heads/master new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/refs/heads/master @@ -0,0 +1,1 @@ +559ab649c979fa77467982b5feb254b665f92950 diff --git a/lib/chameleon/.git/refs/remotes/origin/HEAD b/lib/chameleon/.git/refs/remotes/origin/HEAD new file mode 100644 --- /dev/null +++ b/lib/chameleon/.git/refs/remotes/origin/HEAD @@ -0,0 +1,1 @@ +ref: refs/remotes/origin/master diff --git a/lib/chameleon/.gitignore b/lib/chameleon/.gitignore new file mode 100644 --- /dev/null +++ b/lib/chameleon/.gitignore @@ -0,0 +1,13 @@ +*.pyc +*.egg +*.egg-info +.coverage +.tox/ +coverage.xml +nosetests.xml +*.tar.gz +env25/ +env26/ +env27/ +env32/ +docs/_build/ diff --git a/lib/chameleon/.travis.yml b/lib/chameleon/.travis.yml new file mode 100644 --- /dev/null +++ b/lib/chameleon/.travis.yml @@ -0,0 +1,23 @@ +language: python + +python: + - 2.7 + - pypy + - 3.4 + - 3.5 + - 3.6 + - pypy3 +matrix: + include: + - python: "3.7" + dist: xenial + sudo: true + - python: "3.8-dev" + dist: xenial + sudo: true + +install: + - python setup.py install + +script: + - python setup.py -q test -q diff --git a/lib/chameleon/CHANGES.rst b/lib/chameleon/CHANGES.rst --- a/lib/chameleon/CHANGES.rst +++ b/lib/chameleon/CHANGES.rst @@ -1,6 +1,778 @@ Changes ======= +In next release ... + +- + +3.6.2 (2019-06-22) +------------------ + +- Fix SyntaxWarnings in Python 3.8 resulting from comparing literals with 'is'. + See https://github.com/plone/Products.CMFPlone/issues/2890. + +3.6.1 (2019-04-01) +------------------ + +- Fix limited search expression for illegal double hyphens in HTML + comments to fix issue #289. + +3.6 (2019-02-19) +---------------- + +- Exclude `RuntimeError` (or `RecursionError` when available) from + exception wrapping. + +- Fix double dollar '$$' escaping such that a double dollar is always + resolved, either as an interpolation expression, or as an escape + where it is substituted by a single dollar symbol. This is now + consistent with Zope's handling of this character. + + Backslash-escaping of dollar-based string interpolation is no longer + supported. The documentation has been updated to reflect this + change. + + This fixes issue #283. Note that this reverses some of the changes + introduced to fix issue #265. + +- Drop support for Python 3.3. + +3.5 (2018-10-17) +---------------- + +- Add support for Python 3.8. + +- Add support for TAL attributes in an XML declaration tag. This fixes + issue #269. + +- Add support for custom exception handling for the `tal:on-error` + statement. There is now an option `on_error_handler` available + as a template configuration (issue #266). + +- Fix issue where double '$$' escaping would affect non-interpolation + expressions such as the bare '$$' (issue #265). + +- Fix an issue where backslash dollar escaping would leave the + backslash character still in place. + +3.4 (2018-07-14) +---------------- + +Bugfixes: + +- Fix regression with translations in case of multiple nodes. + + +3.3 (2018-05-23) +---------------- + +Bugfixes: + +- Reset error token when rendering internal macro calls. + +- Fix edge case in exception handler causing recursion. + [MatthewWilkes] + + +3.2 (2017-10-06) +---------------- + +Features: + +- Add the automatic variable ``macroname`` that's bound to the name of + the executing macro. Fixes https://github.com/malthe/chameleon/issues/238 + +- A tokenizer can now be configured on the template class. This is + useful in the case where the template file input is modified before + parsing (for example, where some tags are stripped away) such that + token positions need to be offset accordingly for error locations to + be rendered correctly. + +- Expression errors now display source marker (previously only + filename, line and column was shown). + +- No longer require Python source files to import modules. + [mrh1997] + +Optimizations: + +- Exception tracking now defers metadata allocation to time of error. + + +3.1 (2017-02-21) +---------------- + +Features: + +- Add option ``restricted_namespace`` which controls whether to + restrict namespaces to those defined and used by the page template + language. + [hansroh] + +Bugs: + +- Fixed attribute HTML entity escaping issue where an entity such as + ``&`` would be encoded twice. + +Optimizations: + +- Simplify exception tracking, reducing bytecode size significantly. + +- Avoid checking if a static string is ``None`` during expression + interpolation. + + +3.0 (2016-12-07) +---------------- + +Bugs: + +- Fix issue on Python 2 where an exception was not cleared when using + the pipe operator and was thus accessible through `sys.exc_info()`. + +- The "exists" expression no longer leaks error information. + +- Escape '$$' into '$' in both content and string expressions. + +- Fix use of macro definition inside translation block. + +Improvements: + +- Allow unquoted attribute values. + +- Wrap attribute error thrown when trying to use a non-macro as a + macro as a `RenderError` to get proper error output. + +- Throw a parse error if '--' (double hyphen) appears in an XML + comment. + +- The `i18n:target` attribute now overrides a default + `target_language` variable and is passed to the translation + function. + +- Include filename in the on-disk cache module name. Previously, + only the SHA digest in hex representation would be used, making + it difficult to see where the module came from. This fixes issue + #132. + +- Add support for non-ascii attribute names. + [sank] + +Compatibility: + +- Drop support for Python 2.6, 3.1, and 3.2. + + +2.25 (2016-09-24) +----------------- + +- Add explicit support / testing for Python 3.5. + +- Add ``\r`` to negative regex matches to the chameleon parser, where ``\n`` is used but ``\r`` was missing. + Fixes a case, where the tag name was parsed into ``html\r`` instead of ``html``. + Fixes: https://github.com/malthe/chameleon/issues/219 + + +2.24 (2015-10-28) +----------------- + +- Fixed Python 3.5 compatibility. + +- Fixed brown bag release. + + +2.23 (2015-10-26) +----------------- + +- Added ``enable_data_attributes`` option that allows using HTML5 data + attributes as control attributes instead or in addition to XML + namespace attributes. + + +2.22 (2015-02-06) +----------------- + +- Fix brown bag release. + + +2.21 (2015-02-06) +----------------- + +- Added ``RenderError`` exception which indicates that an error + occurred during the evaluation of an expression. + +- Clean up ``TemplateError`` exception implementation. + + +2.20 (2015-01-12) +----------------- + +- Pass ``search_path`` to template class when loaded using + ``TemplateLoader`` (or one of the derived classes). + [faassen] + + +2.19 (2015-01-06) +----------------- + +- Fix logging deprecation. + +- Fix environment-based configuration logging error. + + +2.18 (2014-11-03) +----------------- + +- Fix minor compilation error. + + +2.17 (2014-11-03) +----------------- + +- Add support for ``i18n:context``. + [wiggy] + +- Add missing 'parity' repeat property. + [voxspox] + +- Don't modify environment when getting variables from it. + [fschulze] + + +2.16 (2014-05-06) +----------------- + +- If a repeat expression evaluates to ``None`` then it is now + equivalent to an empty set. + + This changes a behavior introduced in 2.14. + + This fixes issue #172. + +- Remove fossil test dependency on deprecated ``distribute``. + +- Add explicit support / testing for Python 3.3 / 3.4. + +- Drop explicit support for Python 2.5 (out of maintenance, and no longer + supported by ``tox`` or ``Travis-CI``). + + +2.15 (2014-03-11) +----------------- + +- Add Support for Python 3.4's ``NameConstant``. + [brakhane] + + +2.14 (2013-11-28) +----------------- + +- Element repetition using the ``TAL`` namespace no longer includes + whitespace. This fixes issue #110. + +- Use absolute import for ``chameleon.interfaces`` module. This fixes + issue #161. + + +2.13-1 (2013-10-24) +------------------- + +- Fixing brown bag release. + +2.13 (2013-10-21) +----------------- + +Bugfixes: + +- The template cache mechanism now includes additional configuration + settings as part of the cache key such as ``strict`` and + ``trim_attribute_space``. + [ossmkitty] + +- Fix cache issue where sometimes cached templates would not load + correctly. + [ossmkitty] + +- In debug-mode, correctly remove temporary files when the module + loader is garbage-collected (on ``__del__``). + [graffic] + +- Fix error message when duplicate i18n:name directives are used in a + translation. + +- Using the three-argument form of ``getattr`` on a + ``chameleon.tal.RepeatDict`` no longer raises ``KeyError``, + letting the default provided to ``getattr`` be used. This fixes + attempting to adapt a ``RepeatDict`` to a Zope interface under + PyPy. + +2.12 (2013-03-26) +----------------- + +Changes: + +- When a ``tal:case`` condition succeeds, no other case now will. + +Bugfixes: + +- Implicit translation now correctly extracts and normalizes complete + sentences, instead of words. + [witsch] + +- The ``default`` symbol in a ``tal:case`` condition now allows the + element only if no other case succeeds. + + +2.11 (2012-11-15) +----------------- + +Bugfixes: + +- An issue was resolved where a METAL statement was combined with a + ``tal:on-error`` handler. + +- Fix minor parser issue with incorrectly formatted processing + instructions. + +- Provide proper error handling for Python inline code blocks. + +Features: + +- The simple translation function now supports the + ``translationstring`` interface. + +Optimizations: + +- Minor optimization which correctly detects when an element has no + attributes. + + +2.10 (2012-10-12) +----------------- + +Deprecations: + +- The ``fast_translate`` function has been deprecated. Instead, the + default translation function is now always a function that simply + interpolates the mapping onto the message default or id. + + The motivation is that since version 2.9, the ``context`` argument + is non-trivial: the ``econtext`` mapping is passed. This breaks an + expectation on the Zope platform that the ``context`` parameter is + the HTTP request. Previously, with Chameleon this parameter was + simply not provided and so that did not cause issues as such. + +- The ``ast24`` module has been renamed to ``ast25``. This should help + clear up any confusion that Chameleon 2.x might be support a Python + interpreter less than version 2.5 (it does not). + +Features: + +- The ``ProxyExpr`` expression class (and hence the ``load:`` + expression type) is now a TALES-expression. In practical terms, this + means that the expression type (which computes a string result using + the standard ``"${...}"`` interpolation syntax and proxies the + result through a function) now supports fallback using the pipe + operator (``"|"``). This fixes issue #128. + +- An attempt to interpolate using the empty string as the expression + (i.e. ``${}``) now does nothing: the string ``${}`` is simply output + as is. + +- Added support for adding, modifying, and removing attributes using a + dictionary expression in ``tal:attributes`` (analogous to Genshi's + ``py:attrs`` directive):: + + <div tal:attributes="name value; attrs" /> + + In the example above, ``name`` is an identifier, while ``value`` and + ``attrs`` are Python expressions. However, ``attrs`` must evaluate + to a Python dictionary object (more concisely, the value must + implement the dictionary API-methods ``update()`` and ``items()``). + +Optimizations: + +- In order to cut down on the size of the compiled function objects, + some conversion and quoting statements have been put into + functions. In one measurement, the reduction was 35%. The benchmark + suite does *not* report of an increased render time (actually + slightly decreased). + +Bugfixes: + +- An exception is now raised if a trivial string is passed for + ``metal:fill-slot``. This fixes issue #89. + +- An empty string is now never translated. Not really a bug, but it's + been reported in as an issue (#92) because some translation + frameworks handle this case incorrectly. + +- The template module loader (file cache) now correctly encodes + generated template source code as UTF-8. This fixes issue #125. + +- Fixed issue where a closure might be reused unsafely in nested + template rendering. + +- Fixed markup class ``__repr__`` method. This fixes issue #124. + +- Added missing return statement to fix printing the non-abbreviated + filename in case of an exception. + [tomo] + +2.9.2 (2012-06-06) +------------------ + +Bugfixes: + +- Fixed a PyPy incompatibility. + +- Fixed issue #109 which caused testing failures on some platforms. + +2.9.1 (2012-06-01) +------------------ + +Bugfixes: + +- Fixed issue #103. The ``tal:on-error`` statement now always adds an + explicit end-tag to the element, even with a substitution content of + nothing. + +- Fixed issue #113. The ``tal:on-error`` statement now works correctly + also for dynamic attributes. That is, the fallback tag now includes + only static attributes. + +- Fixed name error which prevented the benchmark from running + correctly. + +Compatibility: + +- Fixed deprecation warning on Python 3 for zope interface implements + declaration. This fixes issue #116. + +2.9.0 (2012-05-31) +------------------ + +Features: + +- The translation function now gets the ``econtext`` argument as the + value for ``context``. Note that historically, this was usually an + HTTP request which might provide language negotiation data through a + dictionary interface. + [alvinyue] + +Bugfixes: + +- Fixed import alias issue which would lead to a syntax error in + generated Python code. Fixes issue #114. + +2.8.5 (2012-05-02) +------------------ + +Bugfixes: + +- Fixed minor installation issues on Python 2.5 and 3. + [ppaez] + +- Ensure output is unicode even when trivial (an empty string). + +2.8.4 (2012-04-18) +------------------ + +Features: + +- In exception output, long filenames are now truncated to 60 + characters of output, preventing line wrap which makes it difficult + to scan the exception output. + +Bugfixes: + +- Include filename and location in exception output for exceptions + raised during compilation. + +- If a trivial translation substitution variable is given (i.e. an + empty string), simply ignore it. This fixes issue #106. + +2.8.3 (2012-04-16) +------------------ + +Features: + +- Log template source on debug-level before cooking. + +- The `target_language` argument, if given, is now available as a + variable in templates. + +2.8.2 (2012-03-30) +------------------ + +Features: + +- Temporary caches used in debug mode are cleaned up eagerly, rather + than waiting for process termination. + [mitchellrj] + +Bugfixes: + +- The `index`, `start` and `end` methods on the TAL repeat object are + now callable. This fixes an incompatibility with ZPT. + +- The loader now correctly handles absolute paths on Windows. + [rdale] + +2.8.1 (2012-03-29) +------------------ + +Features: + +- The exception formatter now lists errors in 'wrapping order'. This + means that the innermost, and presumably most relevant exception is + shown last. + +Bugfixes: + +- The exception formatter now correctly recognizes nested errors and + does not rewrap the dynamically generated exception class. + +- The exception formatter now correctly sets the ``__module__`` + attribute to that of the original exception class. + +2.8.0 (2012-02-29) +------------------ + +Features: + +- Added support for code blocks using the `<?python ... ?>` processing + instruction syntax. + + The scope is name assignments is up until the nearest macro + definition, or the template itself if macros are not used. + +Bugfixes: + +- Fall back to the exception class' ``__new__`` method to safely + create an exception object that is not implemented in Python. + +- The exception formatter now keeps track of already formatted + exceptions, and ignores them from further output. + +2.7.4 (2012-02-27) +------------------ + +- The error handler now invokes the ``__init__`` method of + ``BaseException`` instead of the possibly overriden method (which + may take required arguments). This fixes issue #97. + [j23d, malthe] + +2.7.3 (2012-01-16) +------------------ + +Bugfixes: + +- The trim whitespace option now correctly trims actual whitespace to + a single character, appearing either to the left or to the right of + an element prefix or suffix string. + +2.7.2 (2012-01-08) +------------------ + +Features: + +- Added option ``trim_attribute_space`` that decides whether attribute + whitespace is stripped (at most down to a single space). This option + exists to provide compatibility with the reference + implementation. Fixes issue #85. + +Bugfixes: + +- Ignore unhashable builtins when generating a reverse builtin + map to quickly look up a builtin value. + [malthe] + +- Apply translation mapping even when a translation function is not + available. This fixes issue #83. + [malthe] + +- Fixed issue #80. The translation domain for a slot is defined by the + source document, i.e. the template providing the content for a slot + whether it be the default or provided through ``metal:fill-slot``. + [jcbrand] + +- In certain circumstances, a Unicode non-breaking space character would cause + a define clause to fail to parse. + +2.7.1 (2011-12-29) +------------------ + +Features: + +- Enable expression interpolation in CDATA. + +- The page template class now implements dictionary access to macros:: + + template[name] + + This is a short-hand for:: + + template.macros[name] + +Bugfixes: + +- An invalid define clause would be silently ignored; we now raise a + language error exception. This fixes issue #79. + +- Fixed regression where ``${...}`` interpolation expressions could + not span multiple lines. This fixes issue #77. + +2.7.0 (2011-12-13) +------------------ + +Features: + +- The ``load:`` expression now derives from the string expression such + that the ``${...}`` operator can be used for expression + interpolation. + +- The ``load:`` expression now accepts asset specs; these are resolved + by the ``pkg_resources.resource_filename`` function:: + + <package_name>:<path> + + An example from the test suite:: + + chameleon:tests/inputs/hello_world.pt + +Bugfixes: + +- If an attribute name for translation was not a valid Python + identifier, the compiler would generate invalid code. This has been + fixed, and the compiler now also throws an exception if an attribute + specification contains a comma. (Note that the only valid separator + character is the semicolon, when specifying attributes for + translation via the ``i18n:translate`` statement). This addresses + issue #76. + +2.6.2 (2011-12-08) +------------------ + +Bugfixes: + +- Fixed issue where ``tal:on-error`` would not respect + ``tal:omit-tag`` or namespace elements which are omitted by default + (such as ``<tal:block />``). + +- Fixed issue where ``macros`` attribute would not be available on + file-based templates due to incorrect initialization. + +- The ``TryExcept`` and ``TryFinally`` AST nodes are not available on + Python 3.3. These have been aliased to ``Try``. This fixes issue + #75. + +Features: + +- The TAL repeat item now makes a security declaration that grants + access to unprotected subobjects on the Zope 2 platform:: + + __allow_access_to_unprotected_subobjects__ = True + + This is required for legacy compatibility and does not affect other + environments. + +- The template object now has a method ``write(body)`` which + explicitly decodes and cooks a string input. + +- Added configuration option ``loader_class`` which sets the class + used to create the template loader object. + + The class (essentially a callable) is created at template + construction time. + +2.6.1 (2011-11-30) +------------------ + +Bugfixes: + +- Decode HTML entities in expression interpolation strings. This fixes + issue #74. + +- Allow ``xml`` and ``xmlns`` attributes on TAL, I18N and METAL + namespace elements. This fixes issue #73. + +2.6.0 (2011-11-24) +------------------ + +Features: + +- Added support for implicit translation: + + The ``implicit_i18n_translate`` option enables implicit translation + of text. The ``implicit_i18n_attributes`` enables implicit + translation of attributes. The latter must be a set and for an + attribute to be implicitly translated, its lowercase string value + must be included in the set. + +- Added option ``strict`` (enabled by default) which decides whether + expressions are required to be valid at compile time. That is, if + not set, an exception is only raised for an invalid expression at + evaluation time. + +- An expression error now results in an exception only if the + expression is attempted evaluated during a rendering. + +- Added a configuration option ``prepend_relative_search_path`` which + decides whether the path relative to a file-based template is + prepended to the load search path. The default is ``True``. + +- Added a configuration option ``search_path`` to the file-based + template class, which adds additional paths to the template load + instance bound to the ``load:`` expression. The option takes a + string path or an iterable yielding string paths. The default value + is the empty set. + +Bugfixes: + +- Exception instances now support pickle/unpickle. + +- An attributes in i18n:attributes no longer needs to match an + existing or dynamic attribute in order to appear in the + element. This fixes issue #66. + +2.5.3 (2011-10-23) +------------------ + +Bugfixes: + +- Fixed an issue where a nested macro slot definition would fail even + though there existed a parent macro definition. This fixes issue + #69. + +2.5.2 (2011-10-12) +------------------ + +Bugfixes: + +- Fixed an issue where technically invalid input would result in a + compiler error. + +Features: + +- The markup class now inherits from the unicode string type such that + it's compatible with the string interface. + +2.5.1 (2011-09-29) +------------------ + +Bugfixes: + +- The symbol names "convert", "decode" and "translate" are now no + longer set as read-only *compiler internals*. This fixes issue #65. + +- Fixed an issue where a macro extension chain nested two levels (a + template uses a macro that extends a macro) would lose the middle + slot definitions if slots were defined nested. + + The compiler now throws an error if a nested slot definition is used + outside a macro extension context. + 2.5.0 (2011-09-23) ------------------ diff --git a/lib/chameleon/MANIFEST.in b/lib/chameleon/MANIFEST.in new file mode 100644 --- /dev/null +++ b/lib/chameleon/MANIFEST.in @@ -0,0 +1,3 @@ +recursive-include src/chameleon/tests/inputs * +recursive-include src/chameleon/tests/outputs * +include LICENSE.txt diff --git a/lib/chameleon/README.rst b/lib/chameleon/README.rst --- a/lib/chameleon/README.rst +++ b/lib/chameleon/README.rst @@ -5,11 +5,11 @@ <http://www.python.org>`_. It uses the *page templates* language. You can use it in any Python web application with just about any -version of Python (2.5 and up, including 3.x and `pypy +version of Python (2.7 and up, including 3.4+ and `pypy <http://pypy.org>`_). -Visit the `website <http://pagetemplates.org>`_ for more information -or the `documentation <http://pagetemplates.org/docs/latest/>`_. +Visit the `documentation <https://chameleon.readthedocs.io/en/latest/>`_ +for more information. License and Copyright --------------------- diff --git a/lib/chameleon/benchmarks/bm_chameleon.py b/lib/chameleon/benchmarks/bm_chameleon.py new file mode 100644 --- /dev/null +++ b/lib/chameleon/benchmarks/bm_chameleon.py @@ -0,0 +1,128 @@ +#!/usr/bin/python2 + +""" +Benchmark for test the performance of Chameleon page template engine. +""" + +__author__ = "[email protected] (Malthe Borch)" + +# Python imports +import os +import sys +import optparse +import time + +# Local imports +import util + + +def relative(*args): + return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args) + +sys.path.insert(0, relative('..', 'src')) + +# Chameleon imports +from chameleon import PageTemplate + + +LOREM_IPSUM = """Quisque lobortis hendrerit posuere. Curabitur +aliquet consequat sapien molestie pretium. Nunc adipiscing luc +tus mi, viverra porttitor lorem vulputate et. Ut at purus sem, +sed tincidunt ante. Vestibulum ante ipsum primis in faucibus +orci luctus et ultrices posuere cubilia Curae; Praesent pulvinar +sodales justo at congue. Praesent aliquet facilisis nisl a +molestie. Sed tempus nisl ut augue eleifend tincidunt. Sed a +lacinia nulla. Cras tortor est, mollis et consequat at, +vulputate et orci. Nulla sollicitudin""" + +BASE_TEMPLATE = ''' +<tal:macros condition="False"> + <table metal:define-macro="table"> + <tr tal:repeat="row table"> + <td tal:repeat="col row">${col}</td> + </tr> + </table> + <img metal:define-macro="img" src="${src}" alt="${alt}" /> +</tal:macros> +<html metal:define-macro="master"> + <head><title>${title.strip()}</title></head> + <body metal:define-slot="body" /> +</html> +''' + +PAGE_TEMPLATE = ''' +<html metal:define-macro="master" metal:extend-macro="base.macros['master']"> +<body metal:fill-slot="body"> +<table metal:use-macro="base.macros['table']" /> +images: +<tal:images repeat="nr range(img_count)"> + <img tal:define="src '/foo/bar/baz.png'; + alt 'no image :o'" + metal:use-macro="base.macros['img']" /> +</tal:images> +<metal:body define-slot="body" /> +<p tal:repeat="nr paragraphs">${lorem}</p> +<table metal:use-macro="base.macros['table']" /> +</body> +</html> +''' + +CONTENT_TEMPLATE = ''' +<html metal:use-macro="page.macros['master']"> +<span metal:define-macro="fun1">fun1</span> +<span metal:define-macro="fun2">fun2</span> +<span metal:define-macro="fun3">fun3</span> +<span metal:define-macro="fun4">fun4</span> +<span metal:define-macro="fun5">fun5</span> +<span metal:define-macro="fun6">fun6</span> +<body metal:fill-slot="body"> +<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nam laoreet justo in velit faucibus lobortis. Sed dictum sagittis +volutpat. Sed adipiscing vestibulum consequat. Nullam laoreet, ante +nec pretium varius, libero arcu porttitor orci, id cursus odio nibh +nec leo. Vestibulum dapibus pellentesque purus, sed bibendum tortor +laoreet id. Praesent quis sodales ipsum. Fusce ut ligula sed diam +pretium sagittis vel at ipsum. Nulla sagittis sem quam, et volutpat +velit. Fusce dapibus ligula quis lectus ultricies tempor. Pellente</p> +<span metal:use-macro="template.macros['fun1']" /> +<span metal:use-macro="template.macros['fun2']" /> +<span metal:use-macro="template.macros['fun3']" /> +<span metal:use-macro="template.macros['fun4']" /> +<span metal:use-macro="template.macros['fun5']" /> +<span metal:use-macro="template.macros['fun6']" /> +</body> +</html> +''' + + +def test_mako(count): + template = PageTemplate(CONTENT_TEMPLATE) + base = PageTemplate(BASE_TEMPLATE) + page = PageTemplate(PAGE_TEMPLATE) + + table = [range(150) for i in range(150)] + paragraphs = range(50) + title = 'Hello world!' + + times = [] + for i in range(count): + t0 = time.time() + data = template.render( + table=table, paragraphs=paragraphs, + lorem=LOREM_IPSUM, title=title, + img_count=50, + base=base, + page=page, + ) + t1 = time.time() + times.append(t1-t0) + return times + +if __name__ == "__main__": + parser = optparse.OptionParser( + usage="%prog [options]", + description=("Test the performance of Chameleon templates.")) + util.add_standard_options_to(parser) + (options, args) = parser.parse_args() + + util.run_benchmark(options, options.num_runs, test_mako) diff --git a/lib/chameleon/benchmarks/bm_mako.py b/lib/chameleon/benchmarks/bm_mako.py new file mode 100644 --- /dev/null +++ b/lib/chameleon/benchmarks/bm_mako.py @@ -0,0 +1,153 @@ +#!/usr/bin/python + +""" +Benchmark for test the performance of Mako templates engine. +Includes: + -two template inherences + -HTML escaping, XML escaping, URL escaping, whitespace trimming + -function defitions and calls + -forloops +""" + +__author__ = "[email protected] (Lukasz Fidosz)" + +# Python imports +import os +import sys +import optparse +import time + +# Local imports +import util + +def relative(*args): + return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args) + +sys.path.insert(0, relative('..', 'lib')) + +# Mako imports +from mako.template import Template +from mako.lookup import TemplateLookup + + +LOREM_IPSUM = """Quisque lobortis hendrerit posuere. Curabitur +aliquet consequat sapien molestie pretium. Nunc adipiscing luc +tus mi, viverra porttitor lorem vulputate et. Ut at purus sem, +sed tincidunt ante. Vestibulum ante ipsum primis in faucibus +orci luctus et ultrices posuere cubilia Curae; Praesent pulvinar +sodales justo at congue. Praesent aliquet facilisis nisl a +molestie. Sed tempus nisl ut augue eleifend tincidunt. Sed a +lacinia nulla. Cras tortor est, mollis et consequat at, +vulputate et orci. Nulla sollicitudin""" + +BASE_TEMPLATE = """ +<%def name="render_table(table)"> + <table> + % for row in table: + <tr> + % for col in row: + <td>${col|h}</td> + % endfor + </tr> + % endfor + </table> _______________________________________________ pypy-commit mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-commit
