From 44aa7136de7ae5ff37cdf2b9ec18d1182e149b46 Mon Sep 17 00:00:00 2001 From: Maximillian Dornseif Date: Sun, 24 Oct 2010 23:57:48 +0200 Subject: [PATCH] huTools.http API and function-based pyJasper Interface. Dependencie Reduction This patch introduces a HTTP-API menat to allow easy use on pure Python and AppEngine plattforms. All other huTools modules should reley on them instead of httplib2 and others. pyjasper now comes with an non Object Oriented interface and also strips timestamps from generated PDFs to ensure the same input generates EXACTLY the same output. use hujson instead of simplejson. --- .gitignore | 2 +- Makefile | 30 +- doc/development.markdown | 2 +- .../examples/wms2logos_kommiauftrag.xml | 2 +- huTools/http/__init__.py | 85 ++ huTools/http/_httplib2/__init__.py | 1202 +++++++++++++++++ huTools/http/_httplib2/iri2uri.py | 110 ++ huTools/http/engine_appengine.py | 33 + huTools/http/engine_httplib2.py | 25 + huTools/{ => http}/poster_encode.py | 0 huTools/http/test.py | 64 + huTools/http/tools.py | 111 ++ huTools/pyjasper.py | 192 +-- huTools/rest.py | 3 +- requirements.txt | 2 +- 15 files changed, 1754 insertions(+), 109 deletions(-) create mode 100644 huTools/http/__init__.py create mode 100644 huTools/http/_httplib2/__init__.py create mode 100644 huTools/http/_httplib2/iri2uri.py create mode 100644 huTools/http/engine_appengine.py create mode 100644 huTools/http/engine_httplib2.py rename huTools/{ => http}/poster_encode.py (100%) create mode 100644 huTools/http/test.py create mode 100644 huTools/http/tools.py diff --git a/.gitignore b/.gitignore index 8c21cd4..1485a6d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ dist/ docs/_build/doctrees/* huTools.egg-info/ -testenv/ +pythonenv/ build/ diff --git a/Makefile b/Makefile index ff45647..0aa1d23 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # setting the PATH seems only to work in GNUmake not in BSDmake -PATH := ./testenv/bin:$(PATH) +PATH := ./pythonenv/bin:$(PATH) default: dependencies check test examples @@ -16,18 +16,20 @@ check: -/usr/local/hudorakit/bin/hd_pylint huTools test: - PYTHONPATH=. python huTools/NetStringIO.py - PYTHONPATH=. python huTools/calendar/formats.py - PYTHONPATH=. python huTools/calendar/workdays.py - PYTHONPATH=. python huTools/checksumming.py - PYTHONPATH=. python huTools/humessaging.py - PYTHONPATH=. python huTools/luids.py - PYTHONPATH=. python huTools/obfuscation.py - PYTHONPATH=. python huTools/unicode.py + PYTHONPATH=. ./pythonenv/bin/python huTools/http/test.py + PYTHONPATH=. ./pythonenv/bin/python huTools/NetStringIO.py + PYTHONPATH=. ./pythonenv/bin/python huTools/calendar/formats.py + PYTHONPATH=. ./pythonenv/bin/python huTools/calendar/workdays.py + PYTHONPATH=. ./pythonenv/bin/python huTools/checksumming.py + PYTHONPATH=. ./pythonenv/bin/python huTools/humessaging.py + PYTHONPATH=. ./pythonenv/bin/python huTools/luids.py + PYTHONPATH=. ./pythonenv/bin/python huTools/obfuscation.py + PYTHONPATH=. ./pythonenv/bin/python huTools/unicode.py + PYJASPER_SERVLET_URL=http://127.0.0.1:8000/pyJasper/jasper.py PYTHONPATH=. ./pythonenv/bin/python huTools/pyjasper.py coverage: dependencies printf '.*/tests/.*\n.*test.py\n' > .figleaf-exclude.txt - printf '/usr/local/lib/.*\n/opt/.*\ntestenv/.*\n' >> .figleaf-exclude.txt + printf '/usr/local/lib/.*\n/opt/.*\npythonenv/.*\n' >> .figleaf-exclude.txt printf '.*manage.py\n.*settings.py\n.*setup.py\n.*urls.py\n' >> .figleaf-exclude.txt PYTHONPATH=. /usr/local/hudorakit/bin/hd_figleaf --ignore-pylibs huTools/NetStringIO.py PYTHONPATH=. /usr/local/hudorakit/bin/hd_figleaf --ignore-pylibs huTools/ReReadingConfigParser.py @@ -53,8 +55,8 @@ build: examples python setup.py build dependencies: - virtualenv testenv - pip -q install -E testenv -r requirements.txt + virtualenv pythonenv + pip -q install -E pythonenv -r requirements.txt statistics: sloccount --wide --details huTools | tee sloccount.sc @@ -77,7 +79,7 @@ examples: doc/standards/examples/warenzugang.xml doc/standards/examples/kommiauf clean: - rm -Rf testenv build dist html test.db pylint.out sloccount.sc pip-log.txt + rm -Rf testenv pythonenv build dist html test.db pylint.out sloccount.sc pip-log.txt find . -name '*.pyc' -delete -.PHONY: build clean install upload check doc +.PHONY: build clean install upload check doc docs test diff --git a/doc/development.markdown b/doc/development.markdown index 2bdc858..2f5bb67 100644 --- a/doc/development.markdown +++ b/doc/development.markdown @@ -103,7 +103,7 @@ Use global unique identifiers where ever possible. `huTools.luids.guid128()` cre * Always test Iñtërnâtiônàlizætiøn by putting strange strings into input fields * Always test ` & Co` by putting strange strings into input fields * use [huTools](http://hudora.github.com/huTools/) where appropriate - +* `Iñtërnâtiônàlizætiøn %+'"