Permalink
Browse files

[svn] moved www out of jinja trunk and updated setup.py file

--HG--
branch : trunk
  • Loading branch information...
mitsuhiko committed Mar 22, 2007
1 parent 6947912 commit 0830e25652a68d709e76f5ff0a8b46a2e8b6903f
View
@@ -14,7 +14,7 @@
This file can also be run as a script to install or upgrade setuptools.
"""
import sys
-DEFAULT_VERSION = "0.6b3"
+DEFAULT_VERSION = "0.6c5"
DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3]
md5_data = {
@@ -24,8 +24,21 @@
'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
- 'setuptools-0.6b3dev_r46791-py2.3.egg': 'e765a29566575ffac5d81cdf0c6f8db9',
- 'setuptools-0.6b3dev_r46791-py2.4.egg': 'd249c022ed029ad60d134bd998adc880',
+ 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
+ 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
+ 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
+ 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
+ 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
+ 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
+ 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
+ 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
+ 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
+ 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
+ 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
+ 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
+ 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
+ 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
+ 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
}
import sys, os
@@ -75,13 +88,13 @@ def use_setuptools(
try:
pkg_resources.require("setuptools>="+version)
- except pkg_resources.VersionConflict:
+ except pkg_resources.VersionConflict, e:
# XXX could we install in a subprocess here?
print >>sys.stderr, (
"The required version of setuptools (>=%s) is not available, and\n"
"can't be installed while this script is running. Please install\n"
- " a more recent version first."
- ) % version
+ " a more recent version first.\n\n(Currently using %r)"
+ ) % (version, e.args[0])
sys.exit(2)
def download_setuptools(
@@ -137,15 +150,15 @@ def main(argv, version=DEFAULT_VERSION):
try:
import setuptools
except ImportError:
- import tempfile, shutil
- tmpdir = tempfile.mkdtemp(prefix="easy_install-")
+ egg = None
try:
- egg = download_setuptools(version, to_dir=tmpdir, delay=0)
+ egg = download_setuptools(version, delay=0)
sys.path.insert(0,egg)
from setuptools.command.easy_install import main
return main(list(argv)+[egg]) # we're done here
finally:
- shutil.rmtree(tmpdir)
+ if egg and os.path.exists(egg):
+ os.unlink(egg)
else:
if setuptools.__version__ == '0.0.1':
# tell the user to uninstall obsolete version
View
@@ -0,0 +1,6 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
+
+[aliases]
+release = egg_info -RDb ''
View
@@ -46,13 +46,12 @@
.. _jinja webpage: http://jinja.pocoo.org/
.. _documentation: http://jinja.pocoo.org/documentation/index.html
"""
-try:
- import ez_setup
- ez_setup.use_setuptools()
-except ImportError:
- pass
+import os
+import ez_setup
+ez_setup.use_setuptools()
from setuptools import setup
+
setup(
name = 'Jinja',
version = '1.0',
@@ -77,5 +76,10 @@
],
keywords = ['python.templating.engines'],
packages = ['jinja', 'jinja.translators'],
- extras_require = {'plugin': ['setuptools>=0.6a2']},
+ data_files = [
+ ('docs', os.listdir('docs/build')),
+ ('docs/txt', os.listdir('docs/src'))
+ ],
+ platforms = 'any',
+ extras_require = {'plugin': ['setuptools>=0.6a2']}
)
View
@@ -1,33 +0,0 @@
-<% extends 'layout/base.tmpl' %>
-<% set title = 'Contribute' %>
-<% set active_page = 'contribute' %>
-<% block content %>
- <h1>Contribute</h1>
- <p>
- Because Jinja is an open source project we're always open towards
- suggestions and patches. If you want to participate in the Jinja
- development python knowlege is required of corse since the project is
- implemented completely in python.
- </p>
- <p>
- Development takes place on <a href="http://trac.pocoo.org/">trac.pocoo.org</a>,
- where the Subversion repository, tickets and development Wiki pages
- can be viewed.
- </p>
- <h2>Ways to contact the authors</h2>
- <p>
- Our primary communication instrument is the IRC channel <em>#pocoo</em>
- on the Freenode network. To join it, let your IRC client connect to
- <tt>irc.freenode.net</tt> and do <tt>/join #pocoo</tt>.
- </p>
- <p>
- If you found a bug, just open a ticket in the trac tracker. Be sure to
- add your e-mail address under "CC" to be notified when the issue is fixed.
- </p>
- <h2>The Authors</h2>
- <p>
- Jinja is maintained by <strong>Armin Ronacher</strong> (nickname
- <em>mitsuhiko</em>), e-mail address <em>armin.ronacher (guess what)
- active-4.com</em>.
- </p>
-<% endblock %>
@@ -1,11 +0,0 @@
-<% extends 'layout/base.tmpl' %>
-<% set title = page_title + " | Documentation" %>
-<% set active_page = 'documentation' %>
-<% block content %>
- <h1><%= page_title %></h1>
- <% if page_toc %>
- <h2 class="toc">Table Of Contents</h2>
- <ul><%= page_toc %></ul>
- <% endif %>
- <%= page_body %>
-<% endblock %>
View
@@ -1,25 +0,0 @@
-<% extends 'layout/base.tmpl' %>
-<% set title = 'Download' %>
-<% set active_page = 'download' %>
-<% block content %>
- <h1>Download</h1>
- <p>
- If you want to install the release with
- <a href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a>,
- you can do it using this command:
- </p>
- <pre>easy_install Jinja</pre>
- <p>
- You can also get the development source from subversion using this command:
- </p>
- <pre>svn co http://trac.pocoo.org/repos/jinja/trunk jinja</pre>
- <p>
- Installing the current subversion trunk as a Python egg is done with:
- </p>
- <pre>easy_install Jinja==dev</pre>
- <p>
- Development takes place at the <a href="http://trac.pocoo.org/">Pocoo trac</a>,
- you can browse the source online
- <a href="http://trac.pocoo.org/browser/jinja/trunk">here</a>.
- </p>
-<% endblock %>
View
@@ -1,11 +0,0 @@
-<% extends 'layout/base.tmpl' %>
-<% set title = 'Page Not Found' %>
-<% block content %>
- <h1>Page Not Found</h1>
- <p>
- Sorry, but the pge you requested was not found on this server.
- </p>
- <p>
- Click <a href="index.html">here</a> to return to the index.
- </ul>
-<% endblock %>
View
@@ -1,104 +0,0 @@
-<% extends 'layout/base.tmpl' %>
-<% set title = 'FAQ' %>
-<% set active_page = 'faq' %>
-<% block content %>
- <h1>Frequently Asked Questions</h1>
- <p>
- Here a list of frequently asked questions.
- </p>
- <h2>Why the Name?</h2>
- <p>
- The name Jinja was chosen because it's the name of a Japanese temple and
- temple and template share a similar pronunciation.
- </p>
- <h2>How fast is it?</h2>
- <p>
- I really hate benchmarks especially since they don't reflect much. The
- performance of a template depends on many factors and you would have to
- benchmark different engines in differen situations. However Jinja isn't
- slow. The benchmarks from the testsuite show that Jinja is about twice
- as fast as Django templates and about three times as slow as
- <a href="http://www.makotemplates.org/">mako</a>. That's not bad for a
- sandboxed template engine that has to sanitize template input on the fly.
- If you really need the best performance of a template engine consider
- using mako.
- </p>
- <h2>What happened to Jinja &lt; 1?</h2>
- <p>
- Before Jinja 1 there was a template engine too with the same name. Beside
- the name and the same maintainer those two projects don't share a single
- line of code. If you have an application using Jinja &lt; 1 you should try
- to make it Jinja 1 compatible. If that's not possible, the old project is
- still available as
- <a href="http://trac.pocoo.org/repos/jinja/branches/0.9-maint/">0.9-maint</a>
- in the Jinja subversion repository.
- </p>
- <h2>Why should I use Jinja?</h2>
- <p>
- There are dozens of template engines for Python, many of them try to
- achieve different things. If you are looking for a XML based template
- engine have a look at <a href="http://genshi.edgewall.org/">genshi</a>,
- if you want a bleezing fast template engine with the full range of
- python constructs have a look at mako. If you want sandboxed templates
- you probably want to check out Jinja.
- </p>
- <h2>Differences to Django</h2>
- <p>
- While the Jinja default syntax looks pretty much like Django the rest of
- the template engine works completely different. Jinja was designed to be
- used without Django and to support Python expressions.
- </p>
- <p>Features that Jinja has in common with Django</p>
- <ul>
- <li>filter functions</li>
- <li>block based template inheritance</li>
- <li>the <tt>{% cycle %}</tt> and <tt>{% filter %}</tt> tag</li>
- <li>being sandboxed</li>
- <li>similar default syntax</li>
- </ul>
- <p>Differences to Django</p>
- <ul>
- <li>advanced lexer that allows escaping of tags</li>
- <li>generation of bytecode for faster template execution</li>
- <li>definition of macros (often recurring tasks like rendering
- dialog boxes, form elements etc.)</li>
- <li>raw blocks</li>
- <li>uncoupled internationalization support</li>
- <li>expression support in any tag</li>
- <li>abbility of modifying the context from the template
- by using the <tt>{% set %}</tt> tag.</li>
- <li>support for function calling with arguments</li>
- <li>filters can be called with a variable argument count</li>
- <li>full unicode support</li>
- <li>deferred objects (objects that are resolved on first
- access, not on context instanciation)</li>
- <li>Missing support for <tt>{{ block.super }}</tt></li>
- <li>Support for recursing by using recursing for loops
- or self calling macros.</li>
- <li>If blocks have support for multiple elif statements</li>
- <li>for loops have an optional else block executed if
- there was no iteration.</li>
- <li>test functions like <tt>is even</tt> etc.</li>
- <li>block delimiters are exchangeable.</il>
- <li>no implicit function calling</li>
- <li><tt>{% endblock %}</tt> doesn't support the optional name argument</li>
- <li><tt>{% ifchanged %}</tt> is not implemented because of performance
- reasons. If there's enough interest an implementation might be added</li>
- <li><tt>{% templatetag %}</tt> is not implemented because Jinja supports
- escaping via <tt>{% raw %}</tt> or the variable syntax</li>
- <li><tt>{% comment %}</tt> is not implemented, rather use
- <tt>{# ... #}</tt> for commenting out stuff.</li>
- <li><tt>{% now %}</tt> is not implemented because Jinja doesn't handle
- l10n. Datetime specific stuff should be provided by the application.</li>
- <li><tt>{% load %}</tt>, loading components for Jinja works from the
- application side. Template designers don't have to import stuff on
- their own.</li>
- <li><tt>{% debug %}</tt> is not implemented. You can use the global
- function <tt>debug()</tt>.</li>
- <li>custom tags are not supported. Most of the stuff that is
- possible with django template tags is possible with either functions,
- filters, tests or a combination of them.</li>
- <li>using keywords like <tt>endfor</tt> as identifer raises an
- exception.</li>
- </ul>
-<% endblock %>
View
@@ -1,87 +0,0 @@
-#!/usr/bin/env python
-"""
- jinja webpage generator
- ~~~~~~~~~~~~~~~~~~~~~~~
-"""
-import os
-import sys
-import re
-from codecs import open
-from jinja import Environment, FileSystemLoader
-from jinja.filters import stringfilter
-from pygments import highlight
-from pygments.lexers import get_lexer_by_name
-from pygments.formatters import HtmlFormatter
-
-
-_data_re = re.compile(
- r'<!-- TITLE -->(?P<page_title>.*?)<!-- ENDTITLE -->.*?'
- r'<!-- TOC -->(?P<page_toc>.*?)<!-- ENDTOC -->.*?'
- r'<!-- BODY -->(?P<page_body>.*?)<!-- ENDBODY -->(?sm)'
-)
-
-formatter = HtmlFormatter(cssclass='syntax', encoding=None, style='pastie')
-
-env = Environment('<%', '%>', '<%=', '%>', loader=FileSystemLoader('.',
- cache_folder='/tmp'), trim_blocks=True)
-env.filters['pygmentize'] = stringfilter(lambda v, l:
- highlight(v.strip(), get_lexer_by_name(l), formatter))
-
-
-def get_files(folder):
- for fn in os.listdir(folder):
- fn = os.path.join(folder, fn)
- if os.path.isdir(fn):
- for item in get_files(fn):
- yield item
- elif fn.endswith('.tmpl'):
- yield fn
-
-
-# generate static stuff
-for filename in get_files('.'):
- root = './' + ''.join(['../' for _ in os.path.dirname(filename).
- split(os.path.sep)[1:]])
-
- t = env.get_template(filename)
- f = open(filename[:-5] + '.html', 'w', 'utf-8')
- f.write(t.render(
- root=root
- ))
- f.close()
- print filename
-
-# generate pygments stylesheet
-f = file('static/pygments.css', 'w')
-f.write(formatter.get_style_defs('.syntax'))
-f.close()
-
-# generate documentation
-os.system(sys.executable + ' ../docs/generate.py documentation true')
-
-# render documentation with documentation template
-tmpl = env.get_template('documentation/item.tmpl')
-
-for filename in os.listdir('documentation'):
- if not filename.endswith('.html'):
- continue
- filename = 'documentation/' + filename
- f = open(filename, 'r', 'utf-8')
- try:
- data = f.read()
- finally:
- f.close()
- match = _data_re.search(data)
- if match is None:
- continue
- data = match.groupdict()
- data['page_toc'] = data['page_toc'].strip()
- if data['page_toc'].count('</li') < 2:
- data['page_toc'] = ''
- f = open(filename, 'w', 'utf-8')
- f.write(tmpl.render(
- root='./../',
- **data
- ))
- f.close()
- print 'postprocessed', filename
Oops, something went wrong.

0 comments on commit 0830e25

Please sign in to comment.