Meta.command

Command

class lxu.meta.command.Command

Base class for defining Command servers. The client will subclass this base class, filling in the methods that they require. It’s then instantiated as a metaclass to be promoted to server.

button_name()

Implement to return custom button or icon names.

cmd_add_notifier(name, args)

Call to add a notifier for this command.

cmd_arg_custom(cust)

Call during argument setup to customize the current argument.

cmd_args()

Call to access arguments directly.

cmd_error(err, key)

Call to raise an error with optional message key.

cmd_exec_flags()

Call to get execution flags.

cmd_interaction_ok(err)

Call to test if interaction is OK. If error is true the command fails.

cmd_message(key)

Call to get the message for the command, or – if the key is set – set the message key.

cmd_read_args()

Call to read all argument values.

cmd_read_args_isset()

Call to read all argument ‘isset’ values.

cmd_set_arg(name, value)

Call to set the value of an argument.

enabled()

Implement to test if your command is enabled.

execute()

Implement to execute your command.

icon_name()

Implement to return custom button or icon names.

interact()

Implement to do user interaction.

notifiers()

Implement to add notifiers to your command.

preflight()

Implement to test your command for execution before starting.

setup_args(desc)

Implement to define command arguments.

CustomArgument

class lxu.meta.command.CustomArgument

Base class for implementing custom command argument behaviors.

enabled(cmd)

Implement to enable or disable the argument.

query(cmd)

Implement to return a list of query results.

type(cmd)

Implement to set the variable type.

MetaServer

class lxu.meta.command.MetaServer

The server meta node defines a plug-in server. The name and class guid must be specified, and the alloc() method (defined by the client, returns the server class. There is also a dictionary of server tags.

add(sub)

Add another meta object as a child of this one.

add_tag(key, value)
alloc()

Return the signature for this metaclass. Depends on type.

dump(prefix)

Output the contents of the meta node tree with indenting.

find_any(type, guid, miss)

Find a node with matching type/guid, searching first inside this node but searching higher up the tree until somthing matches.

find_sub(type, guid)

Find first node with a matching type/guid under this node.

flatten()

Return this meta and all sub-metas in a list.

get_ifcs(guid)

Get the list of interfaces matching the given guid under this node. The list is returned as tuples: ((class, meta), …)

init_ifcs(guid)

Initialize the _sub_ifcs attribute as a list of interfaces. If no guid is given we use the metaclass guid itself.

pre_init()

Do any self-modification or other steps before initialization. Return true as long as there is more to do.

set_username(base, key)
test(type, guid)

Test this meta node against a type and guid and return true for match. All testing allows for type or guid to be None for wildcard.

Meta_Command

class lxu.meta.command.Meta_Command

This is the metaclass for the Command server type.

add(sub)

Add another meta object as a child of this one.

add_notifier(name, args)

Notifiers that don’t vary with arguments can be added here.

add_tag(key, value)
alloc()

Internal metaclass method.

dump(prefix)

Output the contents of the meta node tree with indenting.

find_any(type, guid, miss)

Find a node with matching type/guid, searching first inside this node but searching higher up the tree until somthing matches.

find_sub(type, guid)

Find first node with a matching type/guid under this node.

flatten()

Return this meta and all sub-metas in a list.

get_ifcs(guid)

Get the list of interfaces matching the given guid under this node. The list is returned as tuples: ((class, meta), …)

init_ifcs(guid)

Initialize the _sub_ifcs attribute as a list of interfaces. If no guid is given we use the metaclass guid itself.

pre_init()

Do any self-modification or other steps before initialization. Return true as long as there is more to do.

set_type_UI()
set_type_flags(flags)
set_type_model()
set_username(base, key)
test(type, guid)

Test this meta node against a type and guid and return true for match. All testing allows for type or guid to be None for wildcard.

NotifierHost

class lxu.meta.command.NotifierHost

Utility class for managing notifiers on a command.

add(name, args)

Add a notifier by name and args. It’s spawned and appended to the list, but only if there are no clients yet.

add_client(object)

Add a client to all notifiers. It’s placed into a dictionary to prevent adding more than once.

rem_client(object)

Remove a client from all notifiers.

set_arg(dyna, index)

Add the notifiers associated with an argument of the command. This can only be done before clients are added, and only once.

impl_Command

class lxu.meta.command.impl_Command

This internal class implements the actual Command server. It defers to the metaclass state and the client subclass for specific behaviors.

arg_DisableMsg(index, message)

Return true if the argument is disabled, and set the message if any.

arg_UIHints(index, hints)

Set hints for the argument.

arg_UIValueHints(index)

Return a UIValueHints object for the argument.

atrui_DisableMsg(index, message)
atrui_UIHints(index, hints)
atrui_UIValueHints(index)
attr_Count()

Returns number of attributes.

attr_GetFlt(index)
attr_GetInt(index)
attr_GetString(index)
attr_Hints(index)

Returns hint vector for an attribute by index.

attr_Lookup(name)

Returns the index of an attribute given the name.

attr_Name(index)

Returns name of an attribute by index.

attr_SetFlt(index, val)
attr_SetInt(index, val)
attr_SetString(index, val)
attr_Type(index)

Returns basic type of an attribute by index.

attr_TypeName(index)

Returns value type string of an attribute by index.

attr_Value(index, writeOK)

Get value object for an attribute. If writeOK is true the value will be created if it doesn’t exist.

cmd_ArgClear(index)
cmd_ArgDesc(index)
cmd_ArgEnable(index)
cmd_ArgExample(index)
cmd_ArgFlags(index)
cmd_ArgOptionDesc(index, optIndex)
cmd_ArgOptionUserName(index, optIndex)
cmd_ArgParseString(argIndex, argString)
cmd_ArgResetAll()
cmd_ArgSetDatatypes()
cmd_ArgType(index)
cmd_ArgTypeDesc(index)
cmd_ArgTypeUserName(index)
cmd_ArgUserName(index)
cmd_ButtonName()
cmd_ContainedEnable()
cmd_Copy(sourceCommand)
cmd_Desc()
cmd_DialogArgChange(arg)
cmd_DialogFormatting()
cmd_DialogInit()
cmd_Enable(msg)
cmd_Example()
cmd_Execute(flags)
cmd_Flags()
cmd_Help()
cmd_Icon()
cmd_IconImage(w, h)
cmd_Interact()
cmd_Message()
cmd_Name()
cmd_NotifyAddClient(argidx, object)
cmd_NotifyRemoveClient(object)
cmd_PostExecBehaviorFlags()
cmd_PostExecFlags()
cmd_PostExecHints()
cmd_PreExecute()
cmd_Query(index, vaQuery)
cmd_SandboxGUID()
cmd_Tag()
cmd_ToggleArg()
cmd_Tooltip()
cmd_UserName()
dyna_Add(name, type)

Add an attribute to the end of the attribute list. Takes a name and value type string.

dyna_Bool(index, value)
dyna_Clear(index)

Clear a single argument.

dyna_ClearAll()

Clear all arguments.

dyna_Float(index, value)
dyna_GetFlags(index)

Get the argument flags. This computes the VALUE_SET flag dynamically.

dyna_GetType(index)
dyna_HasVariable()

Test if any arguments have variable type.

dyna_Int(index, value)
dyna_IsSet(index)

Returns true if the attribute value is set.

dyna_SetFlags(index, flags)

Set the optional flags int for an attribute.

dyna_SetHint(index, hint)

Set the optional hint vector for an attribute.

dyna_SetType(index, type)

Change the value type for an attribute by index. Setting it to None clears the stored value without changing the type.

dyna_SetVariable()

Set the type of all arguments that have variable type.

dyna_String(index, value)