mrv.maya.ui.dialog

Epydoc: mrv.maya.ui.dialog

Contains some default dialogs as well as layouts suitable for layout dialogs

Classes

Epydoc: mrv.maya.ui.dialog.ChoiceDialog

class mrv.maya.ui.dialog.ChoiceDialog(*args, **kwargs)

Bases: mrv.interface.iChoiceDialog

Maya implementation of the generic choice dialog interface

classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
Returns:list of intermediate children of path, [ child1 , child2 ]
Parameter:predicate – return True to include x in result
Note:the child objects returned are supposed to be valid paths, not just relative paths
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

choice()
Return the choice made by the user
fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
root()
Returns:the root of the DAG - it has no further parents
supports(interface_type)
Returns:True if this instance supports the interface of the given type
Parameter:interface_type – Type of the interface you require this instance to support
Note:Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work

Epydoc: mrv.maya.ui.dialog.Dialog

class mrv.maya.ui.dialog.Dialog(*args, **kwargs)

Bases: mrv.maya.ui.base.BaseUI

Base for all dialog classes

Epydoc: mrv.maya.ui.dialog.ProgressWindow

class mrv.maya.ui.dialog.ProgressWindow(**kwargs)

Bases: mrv.interface.iProgressIndicator

Simple progress window wrapping the default maya progress window

classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
begin()
Show our window
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
Returns:list of intermediate children of path, [ child1 , child2 ]
Parameter:predicate – return True to include x in result
Note:the child objects returned are supposed to be valid paths, not just relative paths
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

end()
Close the progress window
fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
get()
Returns:the current progress value
Note:if set to relative mode, values will range from 0.0 to 100.0. Values will always be within the ones returned by range
isAbortable()
:return : true if the process can be aborted
isCancelRequested()
Returns:True if the action should be cancelled, False otherwise
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRelative()
Returns:true if internal progress computations are relative, False if they are treated as absolute values
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
prefix(value)
Returns:a prefix indicating the progress according to the current range and given value
range()
Returns:tuple( min, max ) value
refresh(message=None)
Finally show the progress window
root()
Returns:the root of the DAG - it has no further parents
roundRobin()
Returns:True if roundRobin mode is enabled
set(value, message=None, omit_refresh=False)

Set the progress of the progress indicator to the given value

Parameters:
  • value – progress value ( min<=value<=max )
  • message – optional message you would like to give to the user
  • omit_refresh – by default, the progress indicator refreshes on set, if False, you have to call refresh manually after you set the value
setAbortable(state)
setRange(min, max)
set the range within we expect our progress to occour
setRelative(state)
enable or disable relative progress computations
setRoundRobin(round_robin)
Set if round-robin mode should be used. If True, values exceeding the maximum range will be wrapped and start at the minimum range
setup(range=None, relative=None, abortable=None, begin=True, round_robin=None)

Multifunctional, all in one convenience method setting all important attributes at once. This allows setting up the progress indicator with one call instead of many

Note:

If a kw argument is None, it will not be set

Parameters:
  • range – Tuple( min, max ) - start ane end of progress indicator range
  • relative – equivalent to setRelative
  • abortable – equivalent to setAbortable
  • round_robin – equivalent to setRoundRobin
  • begin – if True, begin will be called as well
supports(interface_type)
Returns:True if this instance supports the interface of the given type
Parameter:interface_type – Type of the interface you require this instance to support
Note:Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work
value()
Returns:current progress as it is stored internally, without regarding the range or round-robin options.
Note:This allows you to use this instance as a counter without concern to the range and round-robin settings

Epydoc: mrv.maya.ui.dialog.Prompt

class mrv.maya.ui.dialog.Prompt(**kwargs)

Bases: mrv.interface.iPrompt

Implements the prompt interface using a prompt dialog

classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
Returns:list of intermediate children of path, [ child1 , child2 ]
Parameter:predicate – return True to include x in result
Note:the child objects returned are supposed to be valid paths, not just relative paths
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
prompt()

Aquire the information using a prompt dialog

Returns:prompted value if input was confirmed using confirmToken, or the cancelValue if cancelToken was pressed
Note:tokens correspond to buttons
Note:handles batch mode correctly
root()
Returns:the root of the DAG - it has no further parents
supports(interface_type)
Returns:True if this instance supports the interface of the given type
Parameter:interface_type – Type of the interface you require this instance to support
Note:Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work

Epydoc: mrv.maya.ui.dialog.PromptDialog

class mrv.maya.ui.dialog.PromptDialog(title, message, okText, cancelText, **kwargs)

Bases: mrv.maya.ui.dialog.Dialog

Wrapper class for maya prompt dialog

text()
Returns:the entered text or None if the box has been aborted

Epydoc: mrv.maya.ui.dialog

class mrv.maya.ui.dialog.iChoiceDialog(*args, **kwargs)

Bases: mrv.interface.Interface

Interface allowing access to a simple confirm dialog allowing the user to pick between a selection of choices, one of which he has to confirm

Note:for convenience, this interface contains a brief implementation as a basis for subclasses, using standard input and standard ouput for communication
classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
Returns:list of intermediate children of path, [ child1 , child2 ]
Parameter:predicate – return True to include x in result
Note:the child objects returned are supposed to be valid paths, not just relative paths
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

choice()

Make the choice

Returns:name of the choice made by the user, the type shall equal the type given as button names
Note:this implementation always returns the default choice
fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
root()
Returns:the root of the DAG - it has no further parents
supports(interface_type)
Returns:True if this instance supports the interface of the given type
Parameter:interface_type – Type of the interface you require this instance to support
Note:Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work

Epydoc: mrv.maya.ui.dialog

class mrv.maya.ui.dialog.iProgressIndicator(min=0, max=100, is_relative=True, may_abort=False, round_robin=False, **kwargs)

Bases: mrv.interface.Interface

Interface allowing to submit progress information The default implementation just prints the respective messages Additionally you may query whether the computation has been cancelled by the user

Note:this interface is a simple progress indicator itself, and can do some computations for you if you use the get() method yourself
classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
begin()
intiialize the progress indicator before calling set
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
Returns:list of intermediate children of path, [ child1 , child2 ]
Parameter:predicate – return True to include x in result
Note:the child objects returned are supposed to be valid paths, not just relative paths
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

end()
indicate that you are done with the progress indicator - this must be your last call to the interface
fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
get()
Returns:the current progress value
Note:if set to relative mode, values will range from 0.0 to 100.0. Values will always be within the ones returned by range
isAbortable()
Returns:True if the process may be cancelled
isCancelRequested()
Returns:true if the operation should be aborted
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRelative()
Returns:true if internal progress computations are relative, False if they are treated as absolute values
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
prefix(value)
Returns:a prefix indicating the progress according to the current range and given value
range()
Returns:tuple( min, max ) value
refresh(message=None)

Refresh the progress indicator so that it represents its values on screen.

Parameter:message – message passed along by the user
root()
Returns:the root of the DAG - it has no further parents
roundRobin()
Returns:True if roundRobin mode is enabled
set(value, message=None, omit_refresh=False)

Set the progress of the progress indicator to the given value

Parameters:
  • value – progress value ( min<=value<=max )
  • message – optional message you would like to give to the user
  • omit_refresh – by default, the progress indicator refreshes on set, if False, you have to call refresh manually after you set the value
setAbortable(state)
If state is True, the progress may be interrupted, if false it cannot be interrupted
setRange(min, max)
set the range within we expect our progress to occour
setRelative(state)
enable or disable relative progress computations
setRoundRobin(round_robin)
Set if round-robin mode should be used. If True, values exceeding the maximum range will be wrapped and start at the minimum range
setup(range=None, relative=None, abortable=None, begin=True, round_robin=None)

Multifunctional, all in one convenience method setting all important attributes at once. This allows setting up the progress indicator with one call instead of many

Note:

If a kw argument is None, it will not be set

Parameters:
  • range – Tuple( min, max ) - start ane end of progress indicator range
  • relative – equivalent to setRelative
  • abortable – equivalent to setAbortable
  • round_robin – equivalent to setRoundRobin
  • begin – if True, begin will be called as well
supports(interface_type)
Returns:True if this instance supports the interface of the given type
Parameter:interface_type – Type of the interface you require this instance to support
Note:Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work
value()
Returns:current progress as it is stored internally, without regarding the range or round-robin options.
Note:This allows you to use this instance as a counter without concern to the range and round-robin settings

Epydoc: mrv.maya.ui.dialog

class mrv.maya.ui.dialog.iPrompt(**kwargs)

Bases: mrv.interface.Interface

Prompt a value from the user, providing a default if no input is retrieved

classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
Returns:list of intermediate children of path, [ child1 , child2 ]
Parameter:predicate – return True to include x in result
Note:the child objects returned are supposed to be valid paths, not just relative paths
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
prompt()
activate our prompt :return: the prompted value :note: base implementation just prints a sample text and returns the default
root()
Returns:the root of the DAG - it has no further parents
supports(interface_type)
Returns:True if this instance supports the interface of the given type
Parameter:interface_type – Type of the interface you require this instance to support
Note:Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work

Table Of Contents

Previous topic

mrv.maya.ui.panel

Next topic

mrv.maya.ui.util

This Page