# HG changeset patch # User Paul Boddie # Date 1383514436 -3600 # Node ID 1b0783ee86731d34f65b0b1f91163ecad1e7d1f0 # Parent 5e5052387518a3474ad460d73f2e4f358223bdfd Added support for another PDF export URL path. diff -r 5e5052387518 -r 1b0783ee8673 README.txt --- a/README.txt Sun Nov 03 19:40:56 2013 +0100 +++ b/README.txt Sun Nov 03 22:33:56 2013 +0100 @@ -237,8 +237,8 @@ also supports PDF page exports since the "doexportpage" action uses identifiers to indicate which page is to be exported. In an environment that uses .htaccess and mod_rewrite, the redirect.py script should also be deployed -under a separate name (such as export.py) so that it can discover whether it -should be exporting a page instead of just showing it. +under separate names (such as export.py and exportpdf.py) so that it can +discover whether it should be exporting a page instead of just showing it. The search.py script redirects search requests in a suitable form to the MoinMoin "fullsearch" action. diff -r 5e5052387518 -r 1b0783ee8673 config/mailmanwiki-redirect --- a/config/mailmanwiki-redirect Sun Nov 03 19:40:56 2013 +0100 +++ b/config/mailmanwiki-redirect Sun Nov 03 22:33:56 2013 +0100 @@ -1,5 +1,6 @@ ScriptAlias /x "/var/www/mmwiki-scripts/redirect.py" ScriptAlias /pages/viewpage.action "/var/www/mmwiki-scripts/redirect.py" ScriptAlias /pages/doexportpage.action "/var/www/mmwiki-scripts/redirect.py" +ScriptAlias /spaces/flyingpdf/pdfpageexport.action "/var/www/mmwiki-scripts/redirect.py" ScriptAlias /dosearchsite.action "/var/www/mmwiki-scripts/search.py" ScriptAlias /dashboard.action "/var/www/mmwiki-scripts/dashboard.py" diff -r 5e5052387518 -r 1b0783ee8673 config/mailmanwiki-redirect-htaccess --- a/config/mailmanwiki-redirect-htaccess Sun Nov 03 19:40:56 2013 +0100 +++ b/config/mailmanwiki-redirect-htaccess Sun Nov 03 22:33:56 2013 +0100 @@ -12,6 +12,10 @@ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^spaces/flyingpdf/pdfpageexport.action /exportpdf.py [PT,L,QSA] + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^dosearchsite.action /search.py [PT,L,QSA] RewriteCond %{REQUEST_FILENAME} !-f diff -r 5e5052387518 -r 1b0783ee8673 scripts/redirect.py --- a/scripts/redirect.py Sun Nov 03 19:40:56 2013 +0100 +++ b/scripts/redirect.py Sun Nov 03 22:33:56 2013 +0100 @@ -17,6 +17,7 @@ URL_PREFIX = "" EXPORT_SCRIPT = "/export.py" +EXPORT_PDF_SCRIPT = "/exportpdf.py" # See the scripts/tiny.py program for similar code in a stand-alone program. @@ -80,7 +81,12 @@ if pageid is None: fail(pageid) - export = (script.endswith(EXPORT_SCRIPT) or script.endswith("/pages/doexportpage.action")) and args.get("type", [""])[0] == "TYPE_PDF" + export = (script.endswith(EXPORT_SCRIPT) or + script.endswith("/pages/doexportpage.action") + ) and args.get("type", [""])[0] == "TYPE_PDF" or \ + (script.endswith(EXPORT_PDF_SCRIPT) or + script.endswith("/spaces/flyingpdf/pdfpageexport.action") + ) f = open(MAPPING_ID_TO_PAGE) try: