vsgen.writer module

This module provides a simple multi-threaded writer utility for VSGProjects and VSGSolutions

class vsgen.writer.VSGJinjaRenderer[source]

Bases: object

A class defining methods interacting with Jinja2.

render(template, filename, context={}, filters={})[source]

Renders a Jinja2 template to text.

class vsgen.writer.VSGWritable[source]

Bases: object

An interface class defining methods necessary for VSGWriter

lower(value)[source]

Converts a value to lower case in a way compatible with Python2 and Python 3.

Parameters:value (object) – The value to convert.
Returns:The value as lower case text.
text(value)[source]

Converts a value to text in a way compatible with Python2 and Python 3.

Parameters:value (object) – The value to convert.
Returns:The value as text.
upper(value)[source]

Converts a value to upper case text in a way compatible with Python2 and Python 3.

Parameters:value (object) – The value to convert.
Returns:The value as upper case text.
write()[source]

Interface method to ‘write’ the object.

class vsgen.writer.VSGWriteCommand(logname, writables, parallel=True)[source]

Bases: object

The VSGWriteCommand class presents a simple command object to execute the writing methods of a collection of VSGWritable objects.

execute()[source]

Executes the command.

class vsgen.writer.VSGWriter(pylist)[source]

Bases: threading.Thread

VSGWriter encapsulates the logic needed to write any VSG object to disk.

run()[source]

The Thread’s execution function.

static write(pylist, parallel=True)[source]

Utility method to spawn a VSGWriter for each element in a collection.

Parameters:
  • pylist (list) – A list of VSG objects (PrProjects, VSGSolutions, etc)
  • parallel (bool) – Flag to enable asynchronous writing.