1. Michael Kerrin
  2. moin


Michael Kerrin  committed f33b1e7 Merge

Merge main

  • Participants
  • Parent commits 978c255, ff38aed
  • Branches default

Comments (0)

Files changed (8)

File MoinMoin/app.py

View file
         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()

File MoinMoin/apps/frontend/views.py

View file
 # 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',
         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':
             return jsonify(name=subitem_name,
-                           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:

File MoinMoin/templates/index2.html

View file
 {% 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 %}
-<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('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 %}

File MoinMoin/templates/modify_twikidraw.html

View file
 {% block data_editor %}
 <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') }}" />

File quickinstall

View file
 # create a virtual environment in directory $DIR/
 # needs: curl or wget, unzip, gzip, tar, pip
 virtualenv --no-site-packages --python $PYTHON $DIR
 # 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

File quickinstall.bat

View file
 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

File setup.py

View file
         'Werkzeug==0.6.2', # use this if 0.7dev fails
         'py==1.3.4', # py.test 1.3.4 is needed by unit tests
         'sphinx', # needed to build the docs
+        'XStatic-CKEditor',
+        'XStatic-jQuery-File-Upload',
+        'XStatic-svgweb',
+        'XStatic-TWikiDraw-moin',
+        'XStatic-AnyWikiDraw',
     # optional features and their list of requirements
     extras_require = {

File wikiconfig.py

View file
     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,
     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])])
     #item_root = u'Home' # change to some better value