config.cvar module

Provides ConVar functionality in configuration files.

class config.cvar._CvarManager(name, default, description, flags, min_value, max_value)[source]

Bases: dict

Class used to store a cvar instance.

__init__(name, default, description, flags, min_value, max_value)[source]

Called on instantiation.

Parameters:
  • name (str) – Name of the console variable.
  • default (object) – A default value for the console variable. It will be converted to a string.
  • description (str/TranslationStrings) – A description of the console variable.
  • flags (ConVarFlags) – Flags that should be used for the console variable.
  • min_value (float) – Minimum value.
  • max_value (float) – Maximum value.
text(text)[source]

Add a text to the list.

Parameters:text (str/TranslationStrings) – The text to add.
cvar

Return the cvar’s cvars.ConVar instance.

Return type:ConVar
default

Return the cvar’s default value.

Return type:str
description

Return the cvar’s description.

Return type:str
name

Return the cvar’s name.

Return type:str
class config.cvar._ListManager(name)[source]

Bases: list

List class used to store text for a specific descriptor of a cvar.

__init__(name)[source]

Called on instantiation.

append(text)[source]

Override append to add the proper text.

name

Return the name of the list.

Return type:str