# HG changeset patch # User cmlenz # Date 1188595725 0 # Node ID 3110105824e8a414381483f7c9c816f635c7588f # Parent dba522b4c31d7c6e2c575062a7750f2aa2b2acfc Remove some obsoluete, unmaintained examples. diff --git a/examples/includes/common/macros.html b/examples/includes/common/macros.html deleted file mode 100644 --- a/examples/includes/common/macros.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
reference me, please
-
- Hello ${name.title()} -
- - Hello ${select('@name')} - - -
diff --git a/examples/includes/module/test.html b/examples/includes/module/test.html deleted file mode 100644 --- a/examples/includes/module/test.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - ${macro1()} ${macro1()} ${macro1()} - ${macro2('john')} - ${macro2('kate', classname='collapsed')} -
Replace me
- - - Hello Silicon - - diff --git a/examples/includes/run.py b/examples/includes/run.py deleted file mode 100755 --- a/examples/includes/run.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import os -import sys -import timing - -from genshi.template import Context, TemplateLoader - -def test(): - base_path = os.path.dirname(os.path.abspath(__file__)) - loader = TemplateLoader([os.path.join(base_path, 'skins'), - os.path.join(base_path, 'module'), - os.path.join(base_path, 'common')]) - - timing.start() - tmpl = loader.load('test.html') - timing.finish() - print ' --> parse stage: %dms' % timing.milli() - - data = dict(hello='', skin='default', hey='ZYX', bozz=None, - items=['Number %d' % num for num in range(1, 15)]) - - print tmpl.generate(Context(**data)).render(method='html') - - times = [] - for i in range(100): - timing.start() - list(tmpl.generate(Context(**data))) - timing.finish() - times.append(timing.milli()) - sys.stdout.write('.') - sys.stdout.flush() - print - - print ' --> render stage: %dms (avg), %dms (min), %dms (max)' % ( - sum(times) / len(times), min(times), max(times)) - -if __name__ == '__main__': - if '-p' in sys.argv: - import hotshot, hotshot.stats - prof = hotshot.Profile("template.prof") - benchtime = prof.runcall(test) - stats = hotshot.stats.load("template.prof") - stats.strip_dirs() - stats.sort_stats('time', 'calls') - stats.print_stats() - else: - test() diff --git a/examples/includes/skins/default/footer.html b/examples/includes/skins/default/footer.html deleted file mode 100644 --- a/examples/includes/skins/default/footer.html +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/examples/includes/skins/default/header.html b/examples/includes/skins/default/header.html deleted file mode 100644 --- a/examples/includes/skins/default/header.html +++ /dev/null @@ -1,3 +0,0 @@ -
-

Welcome

-
\ No newline at end of file diff --git a/examples/includes/skins/default/layout.html b/examples/includes/skins/default/layout.html deleted file mode 100644 --- a/examples/includes/skins/default/layout.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Hello ${hello} - - - - -
- ${select('*')} -
- - - diff --git a/examples/transform/README.txt b/examples/transform/README.txt deleted file mode 100644 --- a/examples/transform/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This example shows how to transform some HTML input, while adding -elements such as headers, and using / instead of /. -The output is that a proper XTHML document. diff --git a/examples/transform/index.html b/examples/transform/index.html deleted file mode 100644 --- a/examples/transform/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - Aaarrgh - - - - -

Aaargh

-

- Lorem ipsum dolor sit amet, consectetur
- adipisicing elit, sed do eiusmod tempor incididunt ut
- labore et dolore magna aliqua. Ut enim ad minim veniam,
- quis nostrud exercitation ullamco laboris nisi ut
- aliquip ex ea commodo consequat. -

-

- Duis aute irure dolor in reprehenderit in voluptate velit
- esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
- occaecat cupidatat non proident, sunt in culpa qui officia
- deserunt mollit anim id est laborum. -

- - - diff --git a/examples/transform/run.py b/examples/transform/run.py deleted file mode 100644 --- a/examples/transform/run.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import os -import sys - -from genshi.input import HTMLParser -from genshi.template import Context, MarkupTemplate - -def transform(html_filename, tmpl_filename): - tmpl_fileobj = open(tmpl_filename) - tmpl = MarkupTemplate(tmpl_fileobj, tmpl_filename) - tmpl_fileobj.close() - - html_fileobj = open(html_filename) - html = HTMLParser(html_fileobj, html_filename) - print tmpl.generate(Context(input=html)).render('xhtml') - html_fileobj.close() - -if __name__ == '__main__': - basepath = os.path.dirname(os.path.abspath(__file__)) - tmpl_filename = os.path.join(basepath, 'template.xml') - html_filename = os.path.join(basepath, 'index.html') - transform(html_filename, tmpl_filename) diff --git a/examples/transform/template.xml b/examples/transform/template.xml deleted file mode 100644 --- a/examples/transform/template.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - ${select('*')} - - - - ${select('*|text()')} - ${select('*|text()')} - - - ${input} - -