changeset 618:add7c6c78f34 pytest2

merged with default
author pkumar <contactprashantat@gmail.com>
date Mon, 04 Jul 2011 14:26:55 +0530
parents 7899736d7ede (current diff) ff38aed82112 (diff)
children b4784426e4c8
files MoinMoin/apps/admin/templates/highlighterhelp.html MoinMoin/apps/admin/templates/index.html MoinMoin/apps/admin/templates/interwikihelp.html MoinMoin/apps/admin/templates/itemsize.html MoinMoin/apps/admin/templates/sysitems_upgrade.html MoinMoin/apps/admin/templates/userbrowser.html MoinMoin/apps/admin/templates/wikiconfig.html MoinMoin/apps/admin/templates/wikiconfighelp.html MoinMoin/apps/misc/templates/sitemap.xml MoinMoin/apps/misc/templates/urls_names.txt setup.py
diffstat 38 files changed, 256 insertions(+), 276 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/app.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/app.py	Mon Jul 04 14:26:55 2011 +0530
@@ -103,21 +103,21 @@
     from MoinMoin.apps.frontend import frontend
     frontend.before_request(before_wiki)
     frontend.after_request(after_wiki)
-    app.register_module(frontend)
+    app.register_blueprint(frontend)
     from MoinMoin.apps.admin import admin
     admin.before_request(before_wiki)
     admin.after_request(after_wiki)
-    app.register_module(admin, url_prefix='/+admin')
+    app.register_blueprint(admin, url_prefix='/+admin')
     from MoinMoin.apps.feed import feed
     feed.before_request(before_wiki)
     feed.after_request(after_wiki)
-    app.register_module(feed, url_prefix='/+feed')
+    app.register_blueprint(feed, url_prefix='/+feed')
     from MoinMoin.apps.misc import misc
     misc.before_request(before_wiki)
     misc.after_request(after_wiki)
-    app.register_module(misc, url_prefix='/+misc')
+    app.register_blueprint(misc, url_prefix='/+misc')
     from MoinMoin.apps.serve import serve
-    app.register_module(serve, url_prefix='/+serve')
+    app.register_blueprint(serve, url_prefix='/+serve')
     clock.stop('create_app register')
     clock.start('create_app flask-cache')
     cache = Cache()
@@ -146,7 +146,7 @@
             FileSystemLoader(app.cfg.template_dirs),
             app.jinja_env.loader,
         ])
-    app.error_handlers[403] = themed_error
+    app.register_error_handler(403, themed_error)
     clock.stop('create_app flask-themes')
     clock.stop('create_app total')
     del clock
@@ -269,11 +269,7 @@
     try:
         flaskg.unprotected_storage = app.unprotected_storage
 
-        try:
-            flaskg.user = setup_user()
-        except HTTPException as e:
-            # this makes stuff like abort(redirect(...)) work
-            return app.handle_http_exception(e)
+        flaskg.user = setup_user()
 
         flaskg.dicts = app.cfg.dicts()
         flaskg.groups = app.cfg.groups()
--- a/MoinMoin/apps/admin/__init__.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/apps/admin/__init__.py	Mon Jul 04 14:26:55 2011 +0530
@@ -8,7 +8,7 @@
 """
 
 
-from flask import Module
-admin = Module(__name__)
+from flask import Blueprint
+admin = Blueprint('admin', __name__, template_folder='templates')
 import MoinMoin.apps.admin.views
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/highlighterhelp.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,7 @@
+{% import "utils.html" as utils %}
+{% extends theme("layout.html") %}
+{% block content %}
+<h1>{{ _("Available Highlighters") }}</h1>
+{{ utils.table(headings, rows) }}
+{% endblock %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/index.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,23 @@
+{% extends theme("layout.html") %}
+{% block content %}
+<h1>{{ _("Documentation") }}</h1>
+<ul>
+    <li><a href="{{ url_for('serve.files', name='docs', filename='index.html') }}">{{ _("Documentation (local)") }}</a></li>
+</ul>
+<h1>{{ _("Admin Menu") }}</h1>
+<ul>
+    <li><a href="{{ url_for('admin.userbrowser') }}">{{ _("User Browser") }}</a></li>
+    <li><a href="{{ url_for('admin.sysitems_upgrade') }}">{{ _("Upgrade system items") }}</a></li>
+    <li><a href="{{ url_for('admin.wikiconfig') }}">{{ _("Show Wiki Configuration") }}</a></li>
+    <li><a href="{{ url_for('admin.wikiconfighelp') }}">{{ _("Show Wiki Configuration Help") }}</a></li>
+</ul>
+<h1>{{ _("User Menu") }}</h1>
+<ul>
+    <li><a href="{{ url_for('frontend.wanted_items') }}">{{ _("Wanted Items") }}</a></li>
+    <li><a href="{{ url_for('frontend.orphaned_items') }}">{{ _("Orphaned Items") }}</a></li>
+    <li><a href="{{ url_for('admin.itemsize') }}">{{ _("Item sizes (latest revision)") }}</a></li>
+    <li><a href="{{ url_for('admin.interwikihelp') }}">{{ _("Known InterWiki names") }}</a></li>
+    <li><a href="{{ url_for('admin.highlighterhelp') }}">{{ _("Available Highlighters") }}</a></li>
+</ul>
+{% endblock %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/interwikihelp.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,7 @@
+{% import "utils.html" as utils %}
+{% extends theme("layout.html") %}
+{% block content %}
+<h1>{{ _("Known InterWiki names") }}</h1>
+{{ utils.table(headings, rows) }}
+{% endblock %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/itemsize.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,7 @@
+{% import "utils.html" as utils %}
+{% extends theme("layout.html") %}
+{% block content %}
+<h1>{{ _("Item sizes (latest revision)") }}</h1>
+{{ utils.table(headings, rows) }}
+{% endblock %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/sysitems_upgrade.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,14 @@
+{% extends theme("layout.html") %}
+{% block content %}
+<h1>{{ _("System items upgrade") }}</h1>
+<p>
+{{ _("You can upgrade your system items by uploading an xml file with new items below.") }}
+</p>
+<form action="{{ url_for('admin.sysitems_upgrade') }}" method="POST" enctype="multipart/form-data">
+<fieldset>
+    <label for="xmlfile">System items XML file:</label><input type="file" id="xmlfile" name="xmlfile" />
+    <input type="submit" name="submit" value="{{ _("Upgrade system items") }}" />
+</fieldset>
+</form>
+{% endblock %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/userbrowser.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,35 @@
+{% extends theme("layout.html") %}
+{% block content %}
+    <table>
+    <tr>
+        <th>{{ _("User name") }}</th>
+        <th>{{ _("Member of Groups") }}</th>
+        <th>{{ _("Email address") }}</th>
+        <th>{{ _("Actions") }}</th>
+    </tr>
+    {% for u in user_accounts %}
+    <tr>
+        <td><a href="{{ url_for('frontend.show_item', item_name=u.name) }}">{{ u.name }}</a>{{ u.disabled and " (%s)" % _("disabled") or ""}}</td>
+        <td>{{ u.groups|join(',') }}</td>
+        <td>
+            {% if u.email %}
+            <a href="mailto:{{ u.email|e }}" class="mailto">{{ u.email|e }}</a>
+            {% endif %}
+        </td>
+        <td>
+            <form action="{{ url_for('admin.userprofile', user_name=u.name) }}" method="GET">
+                <input type="hidden" name="key" value="disabled" />
+                <input type="hidden" name="val" value="{{ u.disabled and "0" or "1" }}" />
+                <input type="submit" name="userprofile" value="{{ u.disabled and _("Enable user") or _("Disable user") }}" />
+            </form>
+            <form action="{{ url_for('admin.mail_recovery_token') }}" method="GET">
+                <input type="hidden" name="email" value="{{ u.email }}" />
+                <input type="hidden" name="account_sendmail" value="1" />
+                <input type="submit" name="recoverpass" value="{{ _("Mail account data") }}" />
+            </form>
+        </td>
+    </tr>
+    {% endfor %}
+</table>
+{% endblock %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/wikiconfig.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,36 @@
+{% extends theme("layout.html") %}
+{% block content %}
+<h1>{{ _("Wiki configuration") }}</h1>
+<p>
+{{ _("This table shows all settings in this wiki that do not have default values. "
+     "Settings that the configuration system doesn't know about are shown in italic, "
+     "those may be due to third-party extensions needing configuration or settings that "
+     "were removed from Moin.")
+}}
+</p>
+<table>
+<thead>
+<tr>
+<td><strong>{{ _('Variable name') }}</strong></td>
+<td><strong>{{ _('Setting') }}</strong></td>
+</tr>
+</thead>
+<tbody>
+{% for name, value in found %}
+<tr>
+<td>
+    {% if name in settings %}
+        {{ name }}
+    {% else %}
+        <em>{{ name }}</em>
+    {% endif %}
+</td>
+<td>
+    <code>{{ "%r" % (value, ) }}</code>
+</td>
+</tr>
+{% endfor %}
+</tdbody>
+</table>
+{% endblock %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/admin/templates/admin/wikiconfighelp.html	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,29 @@
+{% extends theme("layout.html") %}
+{% block content %}
+<h1>{{ _("WikiConfig Help") }}</h1>
+{% for heading, desc, opts in groups %}
+    <h2>{{ heading }}</h2>
+    {% if desc %}
+        <p>{{ desc }}</p>
+    {% endif %}
+    <table>
+    <thead>
+    <tr>
+        <td><strong>{{ _('Variable name') }}</strong></td>
+        <td><strong>{{ _('Default') }}</strong></td>
+        <td><strong>{{ _('Description') }}</strong></td>
+    </tr>
+    </thead>
+    <tbody>
+    {% for name, default, description in opts %}
+        <tr>
+            <td>{{ name }}</td>
+            <td><code>{{ default }}</code></td>
+            <td>{{ description }}</td>
+        </tr>
+    {% endfor %}
+    </tbody>
+    </table>
+{% endfor %}
+{% endblock %}
+
--- a/MoinMoin/apps/admin/templates/highlighterhelp.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{% import "utils.html" as utils %}
-{% extends theme("layout.html") %}
-{% block content %}
-<h1>{{ _("Available Highlighters") }}</h1>
-{{ utils.table(headings, rows) }}
-{% endblock %}
-
--- a/MoinMoin/apps/admin/templates/index.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-{% extends theme("layout.html") %}
-{% block content %}
-<h1>{{ _("Documentation") }}</h1>
-<ul>
-    <li><a href="{{ url_for('serve.files', name='docs', filename='index.html') }}">{{ _("Documentation (local)") }}</a></li>
-</ul>
-<h1>{{ _("Admin Menu") }}</h1>
-<ul>
-    <li><a href="{{ url_for('admin.userbrowser') }}">{{ _("User Browser") }}</a></li>
-    <li><a href="{{ url_for('admin.sysitems_upgrade') }}">{{ _("Upgrade system items") }}</a></li>
-    <li><a href="{{ url_for('admin.wikiconfig') }}">{{ _("Show Wiki Configuration") }}</a></li>
-    <li><a href="{{ url_for('admin.wikiconfighelp') }}">{{ _("Show Wiki Configuration Help") }}</a></li>
-</ul>
-<h1>{{ _("User Menu") }}</h1>
-<ul>
-    <li><a href="{{ url_for('frontend.wanted_items') }}">{{ _("Wanted Items") }}</a></li>
-    <li><a href="{{ url_for('frontend.orphaned_items') }}">{{ _("Orphaned Items") }}</a></li>
-    <li><a href="{{ url_for('admin.itemsize') }}">{{ _("Item sizes (latest revision)") }}</a></li>
-    <li><a href="{{ url_for('admin.interwikihelp') }}">{{ _("Known InterWiki names") }}</a></li>
-    <li><a href="{{ url_for('admin.highlighterhelp') }}">{{ _("Available Highlighters") }}</a></li>
-</ul>
-{% endblock %}
-
--- a/MoinMoin/apps/admin/templates/interwikihelp.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{% import "utils.html" as utils %}
-{% extends theme("layout.html") %}
-{% block content %}
-<h1>{{ _("Known InterWiki names") }}</h1>
-{{ utils.table(headings, rows) }}
-{% endblock %}
-
--- a/MoinMoin/apps/admin/templates/itemsize.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{% import "utils.html" as utils %}
-{% extends theme("layout.html") %}
-{% block content %}
-<h1>{{ _("Item sizes (latest revision)") }}</h1>
-{{ utils.table(headings, rows) }}
-{% endblock %}
-
--- a/MoinMoin/apps/admin/templates/sysitems_upgrade.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-{% extends theme("layout.html") %}
-{% block content %}
-<h1>{{ _("System items upgrade") }}</h1>
-<p>
-{{ _("You can upgrade your system items by uploading an xml file with new items below.") }}
-</p>
-<form action="{{ url_for('admin.sysitems_upgrade') }}" method="POST" enctype="multipart/form-data">
-<fieldset>
-    <label for="xmlfile">System items XML file:</label><input type="file" id="xmlfile" name="xmlfile" />
-    <input type="submit" name="submit" value="{{ _("Upgrade system items") }}" />
-</fieldset>
-</form>
-{% endblock %}
-
--- a/MoinMoin/apps/admin/templates/userbrowser.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-{% extends theme("layout.html") %}
-{% block content %}
-    <table>
-    <tr>
-        <th>{{ _("User name") }}</th>
-        <th>{{ _("Member of Groups") }}</th>
-        <th>{{ _("Email address") }}</th>
-        <th>{{ _("Actions") }}</th>
-    </tr>
-    {% for u in user_accounts %}
-    <tr>
-        <td><a href="{{ url_for('frontend.show_item', item_name=u.name) }}">{{ u.name }}</a>{{ u.disabled and " (%s)" % _("disabled") or ""}}</td>
-        <td>{{ u.groups|join(',') }}</td>
-        <td>
-            {% if u.email %}
-            <a href="mailto:{{ u.email|e }}" class="mailto">{{ u.email|e }}</a>
-            {% endif %}
-        </td>
-        <td>
-            <form action="{{ url_for('admin.userprofile', user_name=u.name) }}" method="GET">
-                <input type="hidden" name="key" value="disabled" />
-                <input type="hidden" name="val" value="{{ u.disabled and "0" or "1" }}" />
-                <input type="submit" name="userprofile" value="{{ u.disabled and _("Enable user") or _("Disable user") }}" />
-            </form>
-            <form action="{{ url_for('admin.mail_recovery_token') }}" method="GET">
-                <input type="hidden" name="email" value="{{ u.email }}" />
-                <input type="hidden" name="account_sendmail" value="1" />
-                <input type="submit" name="recoverpass" value="{{ _("Mail account data") }}" />
-            </form>
-        </td>
-    </tr>
-    {% endfor %}
-</table>
-{% endblock %}
-
--- a/MoinMoin/apps/admin/templates/wikiconfig.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-{% extends theme("layout.html") %}
-{% block content %}
-<h1>{{ _("Wiki configuration") }}</h1>
-<p>
-{{ _("This table shows all settings in this wiki that do not have default values. "
-     "Settings that the configuration system doesn't know about are shown in italic, "
-     "those may be due to third-party extensions needing configuration or settings that "
-     "were removed from Moin.")
-}}
-</p>
-<table>
-<thead>
-<tr>
-<td><strong>{{ _('Variable name') }}</strong></td>
-<td><strong>{{ _('Setting') }}</strong></td>
-</tr>
-</thead>
-<tbody>
-{% for name, value in found %}
-<tr>
-<td>
-    {% if name in settings %}
-        {{ name }}
-    {% else %}
-        <em>{{ name }}</em>
-    {% endif %}
-</td>
-<td>
-    <code>{{ "%r" % (value, ) }}</code>
-</td>
-</tr>
-{% endfor %}
-</tdbody>
-</table>
-{% endblock %}
-
--- a/MoinMoin/apps/admin/templates/wikiconfighelp.html	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-{% extends theme("layout.html") %}
-{% block content %}
-<h1>{{ _("WikiConfig Help") }}</h1>
-{% for heading, desc, opts in groups %}
-    <h2>{{ heading }}</h2>
-    {% if desc %}
-        <p>{{ desc }}</p>
-    {% endif %}
-    <table>
-    <thead>
-    <tr>
-        <td><strong>{{ _('Variable name') }}</strong></td>
-        <td><strong>{{ _('Default') }}</strong></td>
-        <td><strong>{{ _('Description') }}</strong></td>
-    </tr>
-    </thead>
-    <tbody>
-    {% for name, default, description in opts %}
-        <tr>
-            <td>{{ name }}</td>
-            <td><code>{{ default }}</code></td>
-            <td>{{ description }}</td>
-        </tr>
-    {% endfor %}
-    </tbody>
-    </table>
-{% endfor %}
-{% endblock %}
-
--- a/MoinMoin/apps/admin/views.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/apps/admin/views.py	Mon Jul 04 14:26:55 2011 +0530
@@ -83,7 +83,7 @@
             flash('%s.%s: %s -> %s' % (user_name, key, unicode(oldval), unicode(val), ), "info")
         else:
             flash('modifying %s.%s failed' % (user_name, key, ), "error")
-    return redirect(url_for('admin.userbrowser'))
+    return redirect(url_for('.userbrowser'))
 
 
 @admin.route('/mail_recovery_token', methods=['GET', 'POST', ])
@@ -92,7 +92,7 @@
     Send user an email so he can reset his password.
     """
     flash("mail recovery token not implemented yet")
-    return redirect(url_for('admin.userbrowser'))
+    return redirect(url_for('.userbrowser'))
 
 
 @admin.route('/sysitems_upgrade', methods=['GET', 'POST', ])
@@ -113,7 +113,7 @@
             flash(_('System items upgrade failed due to the following error: %(error)s.', error=e), 'error')
         else:
             flash(_('System items have been upgraded successfully!'))
-        return redirect(url_for('admin.index'))
+        return redirect(url_for('.index'))
 
 
 from MoinMoin.config import default as defaultconfig
--- a/MoinMoin/apps/feed/__init__.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/apps/feed/__init__.py	Mon Jul 04 14:26:55 2011 +0530
@@ -9,7 +9,7 @@
 """
 
 
-from flask import Module
-feed = Module(__name__)
+from flask import Blueprint
+feed = Blueprint('feed', __name__)
 import MoinMoin.apps.feed.views
 
--- a/MoinMoin/apps/frontend/__init__.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/apps/frontend/__init__.py	Mon Jul 04 14:26:55 2011 +0530
@@ -9,7 +9,7 @@
 """
 
 
-from flask import Module
-frontend = Module(__name__)
+from flask import Blueprint
+frontend = Blueprint('frontend', __name__)
 import MoinMoin.apps.frontend.views
 
--- a/MoinMoin/apps/frontend/views.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/apps/frontend/views.py	Mon Jul 04 14:26:55 2011 +0530
@@ -59,7 +59,7 @@
 @frontend.route('/')
 def show_root():
     item_name = app.cfg.item_root
-    location = url_for('frontend.show_item', item_name=item_name)
+    location = url_for('.show_item', item_name=item_name)
     return redirect(location)
 
 @frontend.route('/robots.txt')
@@ -178,7 +178,7 @@
 
 @frontend.route('/+show/<itemname:item_name>')
 def redirect_show_item(item_name):
-    return redirect(url_for('frontend.show_item', item_name=item_name))
+    return redirect(url_for('.show_item', item_name=item_name))
 
 
 @frontend.route('/+dom/<int:rev>/<itemname:item_name>')
@@ -341,7 +341,7 @@
         TextCha(form).amend_form()
         if form.validate():
             item.revert()
-            return redirect(url_for('frontend.show_item', item_name=item_name))
+            return redirect(url_for('.show_item', item_name=item_name))
     return render_template(item.revert_template,
                            item=item, item_name=item_name,
                            rev_no=rev,
@@ -366,7 +366,7 @@
             target = form['target'].value
             comment = form['comment'].value
             item.copy(target, comment)
-            return redirect(url_for('frontend.show_item', item_name=target))
+            return redirect(url_for('.show_item', item_name=target))
     return render_template(item.copy_template,
                            item=item, item_name=item_name,
                            form=form,
@@ -390,7 +390,7 @@
             target = form['target'].value
             comment = form['comment'].value
             item.rename(target, comment)
-            return redirect(url_for('frontend.show_item', item_name=target))
+            return redirect(url_for('.show_item', item_name=target))
     return render_template(item.rename_template,
                            item=item, item_name=item_name,
                            form=form,
@@ -412,7 +412,7 @@
         if form.validate():
             comment = form['comment'].value
             item.delete(comment)
-            return redirect(url_for('frontend.show_item', item_name=item_name))
+            return redirect(url_for('.show_item', item_name=item_name))
     return render_template(item.delete_template,
                            item=item, item_name=item_name,
                            form=form,
@@ -442,7 +442,7 @@
         if form.validate():
             comment = form['comment'].value
             item.destroy(comment=comment, destroy_item=destroy_item)
-            return redirect(url_for('frontend.show_item', item_name=item_name))
+            return redirect(url_for('.show_item', item_name=item_name))
     return render_template(item.destroy_template,
                            item=item, item_name=item_name,
                            rev_no=rev,
@@ -453,7 +453,7 @@
 # XXX this has some functional redundancy with "index", solve that later
 @frontend.route('/+index2/<itemname:item_name>', methods=['GET'])
 def index2(item_name):
-    # flat index using jquery.file-upload (see also jfu_server)
+    # flat index using jquery-file-upload (see also jfu_server)
     return render_template('index2.html',
                            item_name=item_name,
                           )
@@ -469,8 +469,8 @@
             abort(403)
         files = []
         for full_name, rel_name, mimetype in item.flat_index():
-            url = url_for('show_item', item_name=full_name)
-            url_download = url_for('get_item', item_name=full_name)
+            url = url_for('.show_item', item_name=full_name)
+            url_download = url_for('.download_item', item_name=full_name)
             files.append(dict(name=rel_name, url=url, url_download=url_download, size=0))
         return jsonify(files=files)
     if request.method == 'POST':
@@ -484,8 +484,8 @@
                                item_name=item_name)
             return jsonify(name=subitem_name,
                            size=size,
-                           url=url_for('show_item', item_name=item_name, rev=revno),
-                           url_download=url_for('get_item', item_name=item_name, rev=revno),
+                           url=url_for('.show_item', item_name=item_name, rev=revno),
+                           url_download=url_for('.download_item', item_name=item_name, rev=revno),
                           )
         except AccessDeniedError:
             abort(403)
@@ -678,7 +678,7 @@
             msg = _('Your quicklink to this page could not be removed.'), "error"
     if msg:
         flash(*msg)
-    return redirect(url_for('frontend.show_item', item_name=item_name))
+    return redirect(url_for('.show_item', item_name=item_name))
 
 
 @frontend.route('/+subscribe/<itemname:item_name>')
@@ -702,7 +702,7 @@
             msg = _('You could not get subscribed to this item.'), "error"
     if msg:
         flash(*msg)
-    return redirect(url_for('frontend.show_item', item_name=item_name))
+    return redirect(url_for('.show_item', item_name=item_name))
 
 
 class ValidRegistration(Validator):
@@ -808,7 +808,7 @@
                     flash(msg, "error")
                 else:
                     flash(_('Account created, please log in now.'), "info")
-                    return redirect(url_for('frontend.show_root'))
+                    return redirect(url_for('.show_root'))
 
     else:
         # not openid registration and no MoinAuth
@@ -834,7 +834,7 @@
                     flash(msg, "error")
                 else:
                     flash(_('Account created, please log in now.'), "info")
-                    return redirect(url_for('frontend.show_root'))
+                    return redirect(url_for('.show_root'))
 
     return render_template(template,
                            item_name=item_name,
@@ -892,7 +892,7 @@
                 if not is_ok:
                     flash(msg, "error")
             flash(_("If this account exists, you will be notified."), "info")
-            return redirect(url_for('frontend.show_root'))
+            return redirect(url_for('.show_root'))
     return render_template('lostpass.html',
                            item_name=item_name,
                            form=form,
@@ -947,7 +947,7 @@
                 flash(_("Your password has been changed, you can log in now."), "info")
             else:
                 flash(_('Your token is invalid!'), "error")
-            return redirect(url_for('frontend.show_root'))
+            return redirect(url_for('.show_root'))
     return render_template('recoverpass.html',
                            item_name=item_name,
                            form=form,
@@ -1015,7 +1015,7 @@
         form = LoginForm.from_flat(request.form)
         if form.validate():
             # we have a logged-in, valid user
-            return redirect(url_for('frontend.show_root'))
+            return redirect(url_for('.show_root'))
         # flash the error messages (if any)
         for msg in flaskg._login_messages:
             flash(msg, "error")
@@ -1032,7 +1032,7 @@
     for key in ['user.id', 'user.auth_method', 'user.auth_attribs', ]:
         if key in session:
             del session[key]
-    return redirect(url_for('frontend.show_root'))
+    return redirect(url_for('.show_root'))
 
 
 class ValidChangePass(Validator):
@@ -1173,7 +1173,7 @@
                 if success:
                     form.update_object(flaskg.user, omit=['submit']) # don't save submit button value :)
                     flaskg.user.save()
-                    return redirect(url_for('frontend.usersettings'))
+                    return redirect(url_for('.usersettings'))
                 else:
                     # reset to valid values
                     form = FormClass.from_object(flaskg.user)
@@ -1207,7 +1207,7 @@
             flaskg.user.setBookmark(tm)
     else:
         flash(_("You must log in to use bookmarks."), "error")
-    return redirect(url_for('frontend.global_history'))
+    return redirect(url_for('.global_history'))
 
 
 @frontend.route('/+diffraw/<path:item_name>')
--- a/MoinMoin/apps/misc/__init__.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/apps/misc/__init__.py	Mon Jul 04 14:26:55 2011 +0530
@@ -8,7 +8,7 @@
 """
 
 
-from flask import Module
-misc = Module(__name__)
+from flask import Blueprint
+misc = Blueprint('misc', __name__, template_folder='templates')
 import MoinMoin.apps.misc.views
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/misc/templates/misc/sitemap.xml	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+{% for item_name, lastmod, changefreq, priority in sitemap -%}
+<url>
+<loc>{{ url_for('frontend.show_item', item_name=item_name, _external=True)|e }}</loc>
+<lastmod>{{ lastmod }}</lastmod>
+<changefreq>{{ changefreq }}</changefreq>
+<priority>{{ priority }}</priority>
+</url>
+{%- endfor %}
+</urlset>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/apps/misc/templates/misc/urls_names.txt	Mon Jul 04 14:26:55 2011 +0530
@@ -0,0 +1,3 @@
+{% for item_name in item_names -%}
+{{ url_for('frontend.show_item', item_name=item_name, _external=True) }} {{ item_name }}
+{% endfor %}
--- a/MoinMoin/apps/misc/templates/sitemap.xml	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
-{% for item_name, lastmod, changefreq, priority in sitemap -%}
-<url>
-<loc>{{ url_for('frontend.show_item', item_name=item_name, _external=True)|e }}</loc>
-<lastmod>{{ lastmod }}</lastmod>
-<changefreq>{{ changefreq }}</changefreq>
-<priority>{{ priority }}</priority>
-</url>
-{%- endfor %}
-</urlset>
-
-
--- a/MoinMoin/apps/misc/templates/urls_names.txt	Mon Jul 04 14:13:35 2011 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-{% for item_name in item_names -%}
-{{ url_for('frontend.show_item', item_name=item_name, _external=True) }} {{ item_name }}
-{% endfor %}
--- a/MoinMoin/apps/serve/__init__.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/apps/serve/__init__.py	Mon Jul 04 14:26:55 2011 +0530
@@ -10,7 +10,7 @@
 """
 
 
-from flask import Module
-serve = Module(__name__)
+from flask import Blueprint
+serve = Blueprint('serve', __name__)
 import MoinMoin.apps.serve.views
 
--- a/MoinMoin/templates/base.html	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/templates/base.html	Mon Jul 04 14:26:55 2011 +0530
@@ -30,7 +30,7 @@
     {% endblock %}
 
     {% block head_links %}
-    <link rel="shortcut icon" href="{{ url_for('.static', filename='logos/favicon.ico') }}" />
+    <link rel="shortcut icon" href="{{ url_for('static', filename='logos/favicon.ico') }}" />
     <link rel="archives" href="{{ url_for('frontend.history', item_name=item_name) }}" />
     {% set parent_item = theme_supp.parent_item(item_name) %}
     {%- if parent_item -%}
@@ -49,7 +49,7 @@
     {% block head_scripts %}
     <script src="{{ url_for('serve.files', name='jquery', filename='jquery.min.js') }}"></script>
     <script src="{{ url_for('serve.files', name='svgweb', filename='svg.js') }}"></script>
-    <script src="{{ url_for('.static', filename='js/common.js') }}"></script>
+    <script src="{{ url_for('static', filename='js/common.js') }}"></script>
     <script type="text/x-mathjax-config">
   MathJax.Hub.Config({
     extensions: ["tex2jax.js"],
--- a/MoinMoin/templates/global_index.html	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/templates/global_index.html	Mon Jul 04 14:26:55 2011 +0530
@@ -6,7 +6,7 @@
         <ul>
         {% for fullname, relname, contenttype in index %}
             <li>
-                <a href="{{ url_for('show_item', item_name=fullname) }}"
+                <a href="{{ url_for('.show_item', item_name=fullname) }}"
                    class="{{ contenttype|contenttype_to_class }}">
                     {{ relname }}
                 </a>
--- a/MoinMoin/templates/index.html	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/templates/index.html	Mon Jul 04 14:26:55 2011 +0530
@@ -6,7 +6,7 @@
         <ul>
         {% for fullname, relname, contenttype in index %}
             <li>
-                <a href="{{ url_for('show_item', item_name=fullname) }}"
+                <a href="{{ url_for('.show_item', item_name=fullname) }}"
                    class="{{ contenttype|contenttype_to_class }}">
                     {{ relname }}
                 </a>
--- a/MoinMoin/templates/index2.html	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/templates/index2.html	Mon Jul 04 14:26:55 2011 +0530
@@ -2,13 +2,13 @@
 
 {% block theme_stylesheets %}
 {{ super() }}
-<link rel="stylesheet" href="{{ url_for('serve.files', name='fileupload', filename='jquery.fileupload-ui.css') }}">
+<link rel="stylesheet" href="{{ url_for('serve.files', name='jquery_file_upload', filename='jquery.fileupload-ui.css') }}">
 {% endblock %}
 
 {% block content %}
     <h1>{{ _("Index of subitems of '%(item_name)s'", item_name=item_name) }}</h1>
 <div id="file_upload">
-    <form action="{{ url_for('jfu_server', item_name=item_name) }}" method="POST" enctype="multipart/form-data">
+    <form action="{{ url_for('.jfu_server', item_name=item_name) }}" method="POST" enctype="multipart/form-data">
         <input type="file" name="data_file" multiple>
         <button type="submit">Upload</button>
         <div class="file_upload_label">Upload files</div>
@@ -31,7 +31,7 @@
         </tr>
     </table>
 </div>
-<script src="{{ url_for('serve.files', name='fileupload', filename='jquery.fileupload.js') }}"></script>
-<script src="{{ url_for('serve.files', name='fileupload', filename='jquery.fileupload-ui.js') }}"></script>
-<script src="{{ url_for('.static', filename='js/jfu.js') }}"></script>
+<script src="{{ url_for('serve.files', name='jquery_file_upload', filename='jquery.fileupload.js') }}"></script>
+<script src="{{ url_for('serve.files', name='jquery_file_upload', filename='jquery.fileupload-ui.js') }}"></script>
+<script src="{{ url_for('static', filename='js/jfu.js') }}"></script>
 {% endblock %}
--- a/MoinMoin/templates/modify_twikidraw.html	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/templates/modify_twikidraw.html	Mon Jul 04 14:26:55 2011 +0530
@@ -2,7 +2,7 @@
 {% block data_editor %}
 <p>
 <applet code="CH.ifa.draw.twiki.TWikiDraw.class"
-        archive="{{ url_for('serve.files', name='twikidraw', filename='twikidraw.jar') }}"
+        archive="{{ url_for('serve.files', name='twikidraw_moin', filename='twikidraw_moin.jar') }}"
         width="800" height="620">
         <param name="drawpath" value="{{ url_for('frontend.get_item', item_name=item_name, member='drawing.draw') }}" />
         <param name="pngpath"  value="{{ url_for('frontend.get_item', item_name=item_name, member='drawing.png') }}" />
--- a/MoinMoin/templates/snippets.html	Mon Jul 04 14:13:35 2011 +0530
+++ b/MoinMoin/templates/snippets.html	Mon Jul 04 14:26:55 2011 +0530
@@ -2,7 +2,7 @@
 
 {# Logo in the header #}
 {% macro logo() -%}
-<img src="{{ url_for('.static', filename='logos/moinmoin.png') }}" id="moin-img-logo" alt="Logo">
+<img src="{{ url_for('static', filename='logos/moinmoin.png') }}" id="moin-img-logo" alt="Logo">
 {%- endmacro %}
 
 {# Additional HTML tags inside <head> #}
@@ -37,10 +37,10 @@
 {# Image links in the footer #}
 {% macro creditlogos(start='<ul id="moin-creditlogos"><li>'|safe, end='</li></ul>'|safe, sep='</li><li>'|safe) %}
 {{ start }}
-{{ creditlogo('http://moinmo.in/', url_for('.static', filename='logos/moinmoin_powered.png'),
+{{ creditlogo('http://moinmo.in/', url_for('static', filename='logos/moinmoin_powered.png'),
    'MoinMoin powered', 'This site uses the MoinMoin Wiki software.') }}
 {{ sep }}
-{{ creditlogo('http://moinmo.in/Python', url_for('.static', filename='logos/python_powered.png'),
+{{ creditlogo('http://moinmo.in/Python', url_for('static', filename='logos/python_powered.png'),
    'Python powered', 'MoinMoin is written in Python.') }}
 {{ end }}
 {% endmacro %}
--- a/quickinstall	Mon Jul 04 14:13:35 2011 +0530
+++ b/quickinstall	Mon Jul 04 14:26:55 2011 +0530
@@ -2,7 +2,7 @@
 # create a virtual environment in directory $DIR/
 # needs: curl or wget, unzip, gzip, tar, pip
 
-DIR=envxs
+DIR=env
 PYTHON=python
 
 virtualenv --no-site-packages --python $PYTHON $DIR
@@ -26,34 +26,12 @@
 # wikiconfig.py expects them. should be replaced by packaging.
 # we do this FIRST, so that breakage with pip install is better visible.
 
-download $DIR/ckeditor.tgz http://download.cksource.com/CKEditor/CKEditor/CKEditor%203.5/ckeditor_3.5.tar.gz
-tar xz -C $DIR/ -f $DIR/ckeditor.tgz
-
-download $DIR/twd.tgz http://static.moinmo.in/files/packages/TWikiDrawPlugin-moin.tar.gz
-tar xz -C $DIR/ -f $DIR/twd.tgz
-
 download $DIR/svgedit.tgz http://static.moinmo.in/files/packages/svg-edit.tar.gz
 tar xz -C $DIR/ -f $DIR/svgedit.tgz
 
 download $DIR/mathjax.tgz http://static.moinmo.in/files/packages/mathjax.tar.gz
 tar xz -C $DIR/ -f $DIR/mathjax.tgz
 
-mkdir $DIR/jquery.fu
-download $DIR/jquery.fu/jquery.fileupload.js https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload.js
-download $DIR/jquery.fu/jquery.fileupload-ui.js https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload-ui.js
-download $DIR/jquery.fu/jquery.fileupload-ui.css https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload-ui.css
-download $DIR/jquery.fu/pbar-ani.gif https://www.github.com/blueimp/jQuery-File-Upload/raw/master/pbar-ani.gif
-
-download $DIR/svgweb.zip http://svgweb.googlecode.com/files/svgweb-2010-08-10-Owlephant-1.zip
-unzip -q -o -d $DIR/ $DIR/svgweb.zip
-
-AWDDIR='AnyWikiDraw 0.14'
-download $DIR/awd.zip 'http://downloads.sourceforge.net/project/anywikidraw/anywikidraw/anywikidraw-0.14/anywikidraw-0.14.zip?use_mirror=ignum'
-unzip -q -o -d $DIR/ $DIR/awd.zip
-cd $DIR/
-ln -s "$AWDDIR" AnyWikiDraw
-cd ..
-
 # first install babel, moin's setup.py will emit a warning if it is not there
 pip install babel
 # first install XStatic, XStatic-jQuery's setup.py will fail if it is not there
--- a/quickinstall.bat	Mon Jul 04 14:13:35 2011 +0530
+++ b/quickinstall.bat	Mon Jul 04 14:26:55 2011 +0530
@@ -16,24 +16,10 @@
 echo Getting some 3rd party stuff and unpack them into env/, where the default
 echo wikiconfig.py expects them (should be replaced by packaging) ...
 
-wget -nc "http://download.cksource.com/CKEditor/CKEditor/CKEditor 3.5/ckeditor_3.5.tar.gz" -Penv/
-7za x env/ckeditor_3.5.tar.gz -y -oenv\
-7za x env/ckeditor_3.5.tar -y -oenv\
-
-wget -nc http://static.moinmo.in/files/packages/TWikiDrawPlugin-moin.tar.gz -Penv/
-7za x env/TWikiDrawPlugin-moin.tar.gz -y -oenv\
-7za x env/TWikiDrawPlugin-moin.tar -y -oenv\
-
 wget -nc http://static.moinmo.in/files/packages/svg-edit.tar.gz -Penv/
 7za x env/svg-edit.tar.gz -y -oenv\
 7za x env/svg-edit.tar -y -oenv\
 
-wget -nc http://svgweb.googlecode.com/files/svgweb-2010-08-10-Owlephant-1.zip -Penv/
-7za x env/svgweb-2010-08-10-Owlephant-1.zip -y -oenv\
-
-wget -nc http://downloads.sourceforge.net/project/anywikidraw/anywikidraw/anywikidraw-0.14/anywikidraw-0.14.zip?use_mirror=ignum -Penv/
-7za x env/anywikidraw-0.14.zip -y -oenv\
-xcopy "env\AnyWikiDraw 0.14" env\AnyWikiDraw\ /Y /E /H
 
 del /q env\*.tar
 
--- a/setup.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/setup.py	Mon Jul 04 14:26:55 2011 +0530
@@ -76,7 +76,7 @@
     install_requires=[
         'blinker>=1.1', # event signalling (e.g. for change notification trigger)
         'docutils>=0.6', # reST markup processing
-        'Flask>=0.6,<0.7', # micro framework
+        'Flask>=0.7.1', # micro framework
         'Flask-Babel>=0.6', # i18n support
         'Flask-Cache>=0.3.2', # caching support
         'Flask-Script>=0.3', # scripting support
@@ -90,7 +90,12 @@
         'Werkzeug==0.6.2', # use this if 0.7dev fails
         'pytest', # py.test 1.3.4 is needed by unit tests
         'sphinx', # needed to build the docs
+        'XStatic-CKEditor',
         'XStatic-jQuery',
+        'XStatic-jQuery-File-Upload',
+        'XStatic-svgweb',
+        'XStatic-TWikiDraw-moin',
+        'XStatic-AnyWikiDraw',
     ],
     # optional features and their list of requirements
     extras_require = {
--- a/wikiconfig.py	Mon Jul 04 14:13:35 2011 +0530
+++ b/wikiconfig.py	Mon Jul 04 14:26:55 2011 +0530
@@ -56,13 +56,8 @@
     serve_files = dict(
         docs = os.path.join(wikiconfig_dir, 'docs', '_build', 'html'),
         # see "quickinstall" script about how to get those files there
-        ckeditor = os.path.join(wikiconfig_dir, env_dir, 'ckeditor'),
-        svgweb = os.path.join(wikiconfig_dir, env_dir, 'svgweb', 'src'),
-        anywikidraw = os.path.join(wikiconfig_dir, env_dir, 'AnyWikiDraw', 'anywikidraw', 'moinmoin'),
-        twikidraw = os.path.join(wikiconfig_dir, env_dir, 'TWikiDrawPlugin'),
         svgedit = os.path.join(wikiconfig_dir, env_dir, 'svg-edit'),
         mathjax = os.path.join(wikiconfig_dir, env_dir, 'MathJax'),
-        fileupload = os.path.join(wikiconfig_dir, env_dir, 'jquery.fu'),
     )
 
     # we slowly migrate all stuff from above (old) method, to xstatic (new) method,
@@ -71,6 +66,26 @@
     j = JQuery(root_url='/static', provider='local', protocol='http')
     serve_files.update([(j.name, j.get_mapping()[1])])
 
+    from xstatic.pkg.jquery_file_upload import JQueryFileUpload
+    jfu = JQueryFileUpload(root_url='/static', provider='local', protocol='http')
+    serve_files.update([(jfu.name, jfu.get_mapping()[1])])
+
+    from xstatic.pkg.svgweb import SVGWeb
+    sw = SVGWeb(root_url='/static', provider='local', protocol='http')
+    serve_files.update([(sw.name, sw.get_mapping()[1])])
+
+    from xstatic.pkg.ckeditor import CKEditor
+    cke = CKEditor(root_url='/static', provider='local', protocol='http')
+    serve_files.update([(cke.name, cke.get_mapping()[1])])
+
+    from xstatic.pkg.twikidraw_moin import TWikiDraw
+    twd = TWikiDraw(root_url='/static', provider='local', protocol='http')
+    serve_files.update([(twd.name, twd.get_mapping()[1])])
+
+    from xstatic.pkg.anywikidraw import AnyWikiDraw
+    awd = AnyWikiDraw(root_url='/static', provider='local', protocol='http')
+    serve_files.update([(awd.name, awd.get_mapping()[1])])
+
     # ^^^ DON'T TOUCH THIS EXCEPT IF YOU KNOW WHAT YOU DO ^^^
 
     #item_root = u'Home' # change to some better value