sphobjinv.re

Helper regexes for sphobjinv.

sphobjinv is a toolkit for manipulation and inspection of Sphinx objects.inv files.

Author
Brian Skinn (bskinn@alum.mit.edu)
File Created
5 Nov 2017
Copyright
(c) Brian Skinn 2016-2018
Source Repository
http://www.github.com/bskinn/sphobjinv
Documentation
http://sphobjinv.readthedocs.io
License
The MIT License; see LICENSE.txt for full license terms

Members

p_data = re.compile(' ^ # Start of line\n (?P<name>[^#]\\S+) # --> Name\n \\s+ # Dividing space\n (?P<domain>\\w+) # --> Domain\n : , re.MULTILINE|re.VERBOSE)

Compiled re str regex pattern for data lines in str decompressed inventory files

pb_comments = re.compile(b'^#.*$', re.MULTILINE)

Compiled re bytes pattern for comment lines in decompressed inventory files

pb_data = re.compile(b' ^ # Start of line\n (?P<name>[^#]\\S+) # --> Name\n \\s+ # Dividing space\n (?P<domain>\\w+) # --> Domain\n : , re.MULTILINE|re.VERBOSE)

Compiled re bytes regex pattern for data lines in bytes decompressed inventory files

pb_project = re.compile(b'\n ^ # Start of line\n [#][ ]Project:[ ] # Preamble\n (?P<project>.+?) # Lazy rest of line is the project name\n \\r?$ # Ign, re.MULTILINE|re.VERBOSE)

Compiled re bytes pattern for project line

pb_version = re.compile(b'\n ^ # Start of line\n [#][ ]Version:[ ] # Preamble\n (?P<version>.+?) # Lazy rest of line is the version\n \\r?$ # Ignore p, re.MULTILINE|re.VERBOSE)

Compiled re bytes pattern for version line

ptn_data = ' ^ # Start of line\n (?P<name>[^#]\\S+) # --> Name\n \\s+ # Dividing space\n (?P<domain>\\w+) # --> Domain\n : # Dividing colon\n (?P<role>\\w+) # --> Role\n \\s+ # Dividing space\n (?P<priority>-?\\d+) # --> Priority\n \\s+ # Dividing space\n (?P<uri>\\S+) # --> URI\n \\s+ # Dividing space\n (?P<dispname>.+?) # --> Display name, lazy b/c possible CR\n \\r?$ # Ignore possible CR at EOL\n '

Regex pattern string used to compile p_data and pb_data