Details
- Applies to
- MoinMoin/macro/Include.py
- Purpose
- make the Include macro easier to modify
- Description
- my intention is to refactor MoinMoin/macro/Include.py, i.e. make no changes to its behaviour; this will take a couple of patches
Patches
The patches are published here: http://vc.gerg.ca/hg/moin-1.9-refactor-include-patches . That is an MQ repository, i.e. a repository of .hg/patches from a clone of the canonical moin/1.9 repository.
In order, the patches are:
- Add tests for Include macro.
- Factor out several functions that setup the list of pages to include.
- Factor out functions that work on including a single page.
- Factor out the body of the main loop of execute() to include_page().
Factor out parse_args() and IncludeArgs class for parsing/storing args passed to the macro.
Check for macroInclude_pagelist[inc_name] > 1 is bogus: add comment and assertion.
You can review the patches by cloning my MQ repository into a clean clone of moin/1.9:
http://hg.moinmo.in/moin/1.9 moin-1.9 cd moin-1.9 hg clone http://vc.gerg.ca/hg/moin-1.9-refactor-include-patches .hg/patches hg qpush/qpop/etc at will...
Discussion
- Patches are relative to the tip of moin/1.9 as of 2009-01-29
- The tests make fairly stringent assumptions about the formatted HTML output of the macro. That's good for me right now, because I want to ensure I am making no changes to behaviour. But it could make life harder for anyone changing formatting behaviour in future.
ThomasWaldmann said: The formatter defaults to be a html formatter. if that ever changes, we'll have to fix the tests.
Plan
- Priority:
- Assigned to:
Status: be aware that Include is already refactored by the domtree refactoring from Bastian Blank (Include). This domtree refactoring work will be merged after 2.0. If you like to contribute/help please use the version from there. You may want to join us on #moin/#moin-dev on chat.freenode.net -- ReimarBauer 2008-10-29 23:07:10