Permalink
Browse files

Merged with intertwingly...

  • Loading branch information...
2 parents 2d57b62 + 7ba2a1d commit 1f79279f6c61436b19b42d5c4d258d1cb06ff2eb @mortenf mortenf committed Mar 4, 2007
View
@@ -38,6 +38,7 @@
<li><a href="http://bitworking.org/projects/httplib2/">httplib2</a></li>
<li><a href="http://www.w3.org/TR/xslt">XSLT</a></li>
<li><a href="http://www.gnu.org/software/sed/manual/html_mono/sed.html">sed</a></li>
+<li><a href="http://www.djangoproject.com/documentation/templates/">Django templates</a></li>
</ul>
</li>
<li>Credits and License
@@ -107,6 +107,15 @@ <h3 id="ubuntu">Ubuntu Linux (Edgy Eft) instructions</h3>
<blockquote><pre>sudo apt-get install bzr python2.4-librdf</pre></blockquote>
+<h3 id="windows">Windows instructions</h3>
+
+<p>
+ htmltmpl templates (and Django too, since it currently piggybacks on
+ the htmltmpl implementation) on Windows require
+ the <a href="http://sourceforge.net/projects/pywin32/">pywin32</a>
+ module.
+</p>
+
<h3 id="python22">Python 2.2 instructions</h3>
<p>If you are running Python 2.2, you may also need to install <a href="http://pyxml.sourceforge.net/">pyxml</a>. If the
View
@@ -116,6 +116,11 @@
</p>
<p>
+ You also have access to the <code>Config</code> dictionary, which contains
+ the Venus configuration variables from your <code>.ini</code> file.
+</p>
+
+<p>
If you lose your way and want to introspect all the variable in the
context, there's the useful <code>{% debug %}</code> template tag.
</p>
View
@@ -33,6 +33,7 @@ def run(script, doc, output_file=None, options={}):
# datatype converters
context = Context()
context.update(tmpl.template_info(doc))
+ context['Config'] = config.planet_options()
t = get_template(script)
if output_file:
@@ -0,0 +1 @@
+{{ Config.name }}
@@ -26,9 +26,18 @@ def test_django_item_title(self):
os.path.realpath('tests/data/filter/django/title.html.dj'), input)
self.assertEqual(results, "Atom-Powered Robots Run Amok\n")
+ def test_django_config_context(self):
+ config.load('tests/data/filter/django/test.ini')
+ feed = open('tests/data/filter/django/test.xml')
+ input = feed.read(); feed.close()
+ results = dj.run(
+ os.path.realpath('tests/data/filter/django/config.html.dj'), input)
+ self.assertEqual(results, "Django on Venus\n")
+
+
try:
from django.conf import settings
except ImportError:
logger.warn("Django is not available => can't test django filters")
- del DjangoFilterTests.test_django_filter
- del DjangoFilterTests.test_django_item_title
+ for method in dir(DjangoFilterTests):
+ if method.startswith('test_'): delattr(DjangoFilterTests,method)
View
@@ -111,11 +111,18 @@ def test_regexp_filter(self):
try:
from subprocess import Popen, PIPE
- sed=Popen(['sed','--version'],stdout=PIPE,stderr=PIPE)
- sed.communicate()
- if sed.returncode != 0:
+ _no_sed = False
+ try:
+ sed = Popen(['sed','--version'],stdout=PIPE,stderr=PIPE)
+ sed.communicate()
+ if sed.returncode != 0:
+ _no_sed = True
+ except WindowsError:
+ _no_sed = True
+
+ if _no_sed:
logger.warn("sed is not available => can't test stripAd_yahoo")
- del FilterTests.test_stripAd_yahoo
+ del FilterTests.test_stripAd_yahoo
try:
import libxml2

0 comments on commit 1f79279

Please sign in to comment.