Attempts to coerce val to a boolean value. This is largely based off of paste.deploy.converters.asbool() with a few stylistic tweaks added.
| Raises : | ValueError if the value could not be coerced to a True or False value. |
|---|---|
| Returns: | True or False, depending on what val was coerced to. |
Generates a list of links to remove based on which links are preferred.
| Parameters: | |
|---|---|
| Returns: | list of lxml.etree.ElementTree.Element that are safe to be removed. |
Path to an index page (index.html, typically). This function will parse the results into an lxml tree, call remove_links() on the resulting tree, and then convert it back to an HTML page.
| Parameters: | index_path – Absolute path to the index file. This MUST already be created, and must be a file. |
|---|---|
| Raises : | If the file could not be opened, a 404 exception will be raised. |
| Returns: | An lxml formatted HTML page as a string, containing the final, filtered version of the page. |
Controller used to serve up a package listing.
| Parameters: | package_name (string) – Name of the Python package to retrieve and filter the simple page for. Capitalization matters, depending on your operating system–i.e., on Linux, pylons != Pylons. |
|---|---|
| Returns: | The raw simple page if the package was whitelisted, or a filtered page if it was not. |
Predicate used to filter external download links. Currently, the only config value is allowed_extensions.
| Parameters: |
|
|---|---|
| Returns: | True if the external download link should be included in the output, False otherwise. |
Predicate used to filter home pages.
| Parameters: |
|
|---|---|
| Returns: | True if the home page link should be included in the output, False otherwise. |
Predicate used to filter internal download links. Currently, the only config value is allowed_extensions.
| Parameters: |
|
|---|---|
| Returns: | True if the internal download link should be included in the output, False otherwise. |
Filters out links based on the various predicates. Unfortunately, right now, the predicates aren’t configurable.
| Parameters: |
|
|---|---|
| Returns: | A modified lxml.tree with specific links filtered out. |
Parses through a list of elements, and splits them up based on their type.
| Parameters: |
|
|---|---|
| Returns: | Tuple of lists, (external_download_links, home_pages, internal_download_links, unknown_links). |