Skip to main content

Information about path configuration in Morepath

Project description

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.

Columns

The columns in the CSV file are as follows:

path

The URL path. If this is a named view, the view name is appended with a +. If this is an absorb path, the /... is appended. If this is an internal view, the path will be internal.

directive

The directive used.

filename

The filename in which this configuration was made.

lineno

The line number of the configuration.

model

A dotted name to the model class exposed.

permission

A dotted name to the permission used for the path. Or public if no permission declared, or internal if this is an internal view. path and mount directives have no permission.

view_name

The view name predicate, if any. By default this is empty. path and mount directives have no view name.

request_method

The request method predicate. By default this is GET` ``path and mount directives have no request method predicates.

extra_predicates

Whether there are additional predicates in use. Go to the actual code to see them.

CHANGES

0.6.1 (2016-11-09)

  • Fix README; it was naming the csv-dialect option wrong.

0.6 (2016-11-09)

  • Added the --csv-dialect option so you can indicate the CSV dialect to use.

  • Added a europe dialect where the delimiter is ;, not ,. This to support Excel in Europe, as its CSV format is locale-dependent. (why…)

0.5 (2016-11-01)

  • Initial public release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

more.pathtool-0.6.1.tar.gz (8.1 kB view details)

Uploaded Source

File details

Details for the file more.pathtool-0.6.1.tar.gz.

File metadata

File hashes

Hashes for more.pathtool-0.6.1.tar.gz
Algorithm Hash digest
SHA256 af21a8364f4b15cd748492abd9a46c0024957ebe96bb771e060e775846924e09
MD5 3f5535e17c04b027e13297a874101327
BLAKE2b-256 4312e114e13cad4979165ac285768caf778ee7fa012b5ce43d39f4b056d00b3f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page