cvars package¶
Module contents¶
Provides access to ConVar instances and the ability to create a ConVar.
-
class
cvars.
ConVar
¶ Bases:
_commands.ConCommandBase
,_cvars._IConVar
-
__init__
((object)arg1, (str)name[, (str)value=''[, (str)description=''[, (Channel)flags=0[, (object)min_value=None[, (object)max_value=None]]]]]) → object :¶ Called when a server-var is initilized.
If the ConVar already exists, all other parameters except
name
are inconsequential.Parameters: - name (str) – The name of the ConVar.
- value (str) – The initial value of the ConVar if it doesn’t already exist.
- description (str) – The description of the ConVar.
- flags (ConVarFlags) – The initial flags of the ConVar if it doesn’t already exist.
- min_value (float) – The minimum value allowed for the ConVar.
- max_value (float) – The maximum value allowed for the ConVar.
-
make_public
((ConVar)arg1) → None :¶ Set the notify flag and make the console variable public.
-
remove_public
((ConVar)arg1) → None :¶ Remove the notify flag and make the console variable no longer public.
-
revert
((ConVar)arg1) → None :¶ Reset the console variable to its default value.
-
set_bool
((ConVar)arg1, (bool)value) → None :¶ Set the console variable to a boolean value.
-
-
class
cvars.
_Cvar
¶ Bases:
Boost.Python.instance
-
__init__
()¶ Raises an exception This class cannot be instantiated from Python
-
call_global_change_callbacks
((_Cvar)arg1, (ConVar)cvar, (str)old_string, (float)old_float) → None :¶ Call all global change callbacks.
Parameters:
-
find_base
((_Cvar)arg1, (str)name) → ConCommandBase :¶ Find the ConCommandBase instance of a server command or console variable.
Returns: Return None
if the command or variable was not found.Return type: ConCommandBase
-
find_command
((_Cvar)arg1, (str)name) → ConCommand :¶ Find the ConCommand instance of a server command.
Returns: Return None
if the command was not found.Return type: ConCommand
-
find_var
((_Cvar)arg1, (str)name) → ConVar :¶ Find the ConVar instance of console variable.
Returns: Return None
if the console variable was not found.Return type: ConVar
-
register_base
((_Cvar)arg1[, (ConCommandBase)con_command=True]) → None :¶ Register a console command.
-
unregister_base
((_Cvar)arg1, (ConCommandBase)con_command) → None :¶ Unregister a console command.
-
commands
¶ Return the first ConCommandBase instance that can be used to iterate through all ConCommandBase instances
.:rtype: ConCommandBase
-
-
cvars.
cvar
¶ The singleton instance for
cvars._Cvar
.