markerlib /

Filename Size Date modified Message
markerlib
115 B
incorporate parts of ast needed for Python 2.5
500 B
version 0.5.2
14 B
include changes; bump version
518 B
version 0.4 - cache markers; markerlib.compile()
109 B
initial commit
1.2 KB
version 0.5.2
359 B
no longer try to support Python < 2.6

markerlib

Compile or interpret PEP 345 environment markers.

Usage:

>>> import markerlib
>>> marker = markerlib.compile("os.name == 'posix'")
>>> marker(environment=markerlib.default_environment(),
           override={'os.name':'posix'})
True
>>> marker(environment=markerlib.default_environment(),
           override={'os.name':'nt'})
False

The implementation uses the ast to compile environment markers as Python statements with a limited set of allowed node types.