fab.tools.flags module#

This file contains a simple Flag class to manage tool flags. It will need to be combined with build_config.FlagsConfig in a follow up PR.

class fab.tools.flags.Flags(list_of_flags=None)#

Bases: list

This class represents a list of parameters for a tool. It is a list with some additional functionality.

TODO #22: This class and build_config.FlagsConfig should be combined.

Parameters:

list_of_flags (Optional[List[str]]) – List of parameters to initialise this object with. (default: None)

checksum()#
Return type:

str

Returns:

a checksum of the flags.

remove_flag(remove_flag, has_parameter=False)#

Removes all occurrences of remove_flag in flags`. If has_parameter is defined, the next entry in flags will also be removed, and if this object contains this flag+parameter without space (e.g. -J/tmp), it will be correctly removed. Note that only the flag itself must be specified, you cannot remove a flag only if a specific parameter is given (i.e. remove_flag=”-J/tmp” will not work if this object contains […,”-J”, “/tmp”]).

Parameters:
  • remove_flag (str) – the flag to remove

  • has_parameter (bool) – if the flag to remove takes a parameter (default: False)