more.pathtool: info about paths in Morepath apps

more.pathtool lets you create a tool that generates information about paths in a Morepath application. This way you can see exactly what paths a Morepath application supports, including views and mounted applications. It does this by reading the configuration information of a Morepath application.

To create such a tool you do the following, for instance in tool.py of your project:

from more.pathtool import path_tool from .someplace import SomeApp def my_path_tool(): SomeApp.commit() path_tool(SomeApp)

where SomeApp is the application you want to query, typically the root application of your project.

Now you need to hook it up in setup.py to you can have the tool available:

entry_points={ 'console_scripts': [ 'morepathtool = myproject.tool:my_path_tool', ] },

You also need to include more.pathtool in your setup requirements.

After you install your project, you should now have a morepathtool tool available that lets you query your project for path information.

By default the path tool generates a CSV file with information in it about paths in your application:

$ morepathtool paths.csv

You can open it in a spreadsheet application such as Excel or OpenOffice Calc. Note that if you your locale is European you have to add -csv-dialect=europe to set the CVS writer to use ;` as the delimiter instead of , so that Excel can read it.