compspec package ¶
Subpackages ¶
Submodules ¶
compspec.entity module ¶
- class compspec.entity. Counter ( prefix = 'id' ) [source] ¶
-
Bases:
object
A simple counter (iterator) that will yield the next number with some prefix.
compspec.graph module ¶
- class compspec.graph. Graph [source] ¶
-
Bases:
object
A graph implicitly is scoped to one namespace
- gen ( name , value , parent , nodeid = None , relation = 'has' , is_connector = False ) [source] ¶
-
Generate a node and relation in one swoop! A parent is required.
- iter_nodes ( ) [source] ¶
-
Yield nodes. If a comparison is being done, a namespace needs to be added (e.g., node, namespace, * args)
- new_node ( name , value , nodeid = None , is_connector = False ) [source] ¶
-
Generate a node with a name (type) and value
is_connector is a flag that indicates the node is included in the graph, but itself should not be assessed for add/change/remove.
compspec.logger module ¶
- class compspec.logger. ColorizingStreamHandler ( nocolor=False , stream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'> , use_threads=False ) [source] ¶
-
Bases:
StreamHandler
- BLACK = 0 ¶
- BLUE = 4 ¶
- BOLD_SEQ = '\x1b[1m' ¶
- COLOR_SEQ = '\x1b[%dm' ¶
- CYAN = 6 ¶
- GREEN = 2 ¶
- MAGENTA = 5 ¶
- RED = 1 ¶
- RESET_SEQ = '\x1b[0m' ¶
- WHITE = 7 ¶
- YELLOW = 3 ¶
- colors = {'CRITICAL': 1, 'DEBUG': 4, 'ERROR': 1, 'INFO': 2, 'WARNING': 3} ¶
- emit ( record ) [source] ¶
-
Emit a record.
If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an ‘encoding’ attribute, it is used to determine how to do the output to the stream.
- property is_tty ¶
compspec.solver module ¶
compspec.utils module ¶
- compspec.utils. normalize_key ( key ) [source] ¶
-
A key needs to be all lowercase, ideally with no spaces, etc.
- compspec.utils. recursive_find ( base , pattern = '*.py' ) [source] ¶
-
recursive find will yield python files in all directory levels below a base path.
- Arguments:
-
-
base (str) : the base directory to search
-
pattern: a pattern to match, defaults to * .py
-