mrv.maya.ui.qa

Epydoc: mrv.maya.ui.qa

Contains a modular UI able to display quality assurance checks, run them and present their results. It should be easy to override and adjust it to suit additional needs

Functions

mrv.maya.ui.qa.capitalize(s)
Returns:s with first letter capitalized

Classes

Epydoc: mrv.maya.ui.qa.QACheckLayout

class mrv.maya.ui.qa.QACheckLayout(*args, **kwargs)

Bases: mrv.maya.ui.RowLayout

Row Layout able to display a qa check and related information

Note:currently we make assumptions about the positions of the children in the RowLayout, thus you may only append new ones
classmethod activeParent()
Returns:NameUI of the currently set parent
Raises RuntimeError:
 if no active parent was set
add(child, set_self_active=False, revert_to_previous_parent=True)

Add the given child UI item to our list of children

Parameters:
  • set_self_active – if True, we explicitly make ourselves the current parent for newly created UI elements
  • revert_to_previous_parent – if True, the previous parent will be restored once we are done, if False we keep the parent - only effective if set_self_active is True
Returns:

the newly added child, allowing contructs like button = layout.addChild( Button( ) )

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
annotation()
:return : the annotation string
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
capitalize

S.capitalize() -> unicode

Return a capitalized version of S, i.e. make the first character have upper case.

center

S.center(width[, fillchar]) -> unicode

Return S centered in a Unicode string of length width. Padding is done using the specified fill character (default is a space)

check()
Returns:check we are operating upon
checkError(exception, workflow)

Called if the checks fails with an error

Parameters:
  • exception – exception object that was thrown by our check
  • workflow – workflow that ran the check
childByName(childname)
Returns:stored child instance, specified either as short name ( without pipes ) or fully qualified ( i.e. mychild or parent|subparent|mychild” )
Raises KeyError:
 if a child with that name does not exist
children()
Returns:children of this layout
childrenDeep(**kwargs)
Returns:all child instances recursively
Note:the order of children is lexically ordered at this time
Note:this implementation is slow and should be overridden by more specialized subclasses
clearAllEvents()

Remove all event receivers for all events registered in this instance.

Note:This usually doesn’t need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance
clearChildren()
Clear our child arrays to quickly forget about our children
count

S.count(sub[, start[, end]]) -> int

Return the number of non-overlapping occurrences of substring sub in Unicode string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

decode

S.decode([encoding[,errors]]) -> string or unicode

Decodes S using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is ‘strict’ meaning that encoding errors raise a UnicodeDecodeError. Other possible values are ‘ignore’ and ‘replace’ as well as any other name registerd with codecs.register_error that is able to handle UnicodeDecodeErrors.

delete()
Delete this UI - the wrapper instance must not be used after this call
deleteChild(child)
Delete the given child ui physically so it will not be shown anymore after removing it from our list of children
dimension()
Returns:(x,y) tuple of x and y dimensions of the UI element
e_dgc
Event suitable to deal with user interface callback
e_dpc
Event suitable to deal with user interface callback
e_dragCallback
Event suitable to deal with user interface callback
e_dropCallback
Event suitable to deal with user interface callback
e_vcc
Event suitable to deal with user interface callback
e_visibleChangeCommand
Event suitable to deal with user interface callback
encode

S.encode([encoding[,errors]]) -> string or unicode

Encodes S using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith

S.endswith(suffix[, start[, end]]) -> bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

exists()
Returns:True if this instance still exists in maya
expandtabs

S.expandtabs([tabsize]) -> unicode

Return a copy of S where all tab characters are expanded using spaces. If tabsize is not given, a tab size of 8 characters is assumed.

find

S.find(sub [,start [,end]]) -> int

Return the lowest index in S where substring sub is found, such that sub is contained within s[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format
S.format(*args, **kwargs) -> unicode
fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
index

S.index(sub [,start [,end]]) -> int

Like S.find() but raise ValueError when the substring is not found.

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
isalnum

S.isalnum() -> bool

Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.

isalpha

S.isalpha() -> bool

Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.

isdecimal

S.isdecimal() -> bool

Return True if there are only decimal characters in S, False otherwise.

isdigit

S.isdigit() -> bool

Return True if all characters in S are digits and there is at least one character in S, False otherwise.

islower

S.islower() -> bool

Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.

isnumeric

S.isnumeric() -> bool

Return True if there are only numeric characters in S, False otherwise.

isspace

S.isspace() -> bool

Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.

istitle

S.istitle() -> bool

Return True if S is a titlecased string and there is at least one character in S, i.e. upper- and titlecase characters may only follow uncased characters and lowercase characters only cased ones. Return False otherwise.

isupper

S.isupper() -> bool

Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.

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
join

S.join(iterable) -> unicode

Return a string which is the concatenation of the strings in the iterable. The separator between elements is S.

listChildren(predicate=<function <lambda> at 0x6063578>)
Returns:list with our child instances
Parameter:predicate – function returning True for each child to include in result, allows to easily filter children
Note:it’s a copy, so you can freely act on the list
Note:children will be returned in the order in which they have been added
classmethod listEventNames()
Returns:list of event ids that exist on our class
ljust

S.ljust(width[, fillchar]) -> int

Return S left-justified in a Unicode string of length width. Padding is done using the specified fill character (default is a space).

lower

S.lower() -> unicode

Return a copy of the string S converted to lowercase.

lstrip

S.lstrip([chars]) -> unicode

Return a copy of the string S with leading whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is a str, it will be converted to unicode before stripping

p_ad1
p_ad2
p_ad3
p_ad4
p_ad5
p_ad6
p_adj
p_adjustableColumn
p_adjustableColumn1
p_adjustableColumn2
p_adjustableColumn3
p_adjustableColumn4
p_adjustableColumn5
p_adjustableColumn6
p_ann
:return : the annotation string
p_annotation
:return : the annotation string
p_backgroundColor
p_bgc
p_ca
Returns:children of this layout
p_cal
p_cat
p_childArray
Returns:children of this layout
p_cl1
p_cl2
p_cl3
p_cl4
p_cl5
p_cl6
p_co1
p_co2
p_co3
p_co4
p_co5
p_co6
p_columnAlign
p_columnAlign1
p_columnAlign2
p_columnAlign3
p_columnAlign4
p_columnAlign5
p_columnAlign6
p_columnAttach
p_columnAttach1
p_columnAttach2
p_columnAttach3
p_columnAttach4
p_columnAttach5
p_columnAttach6
p_columnOffset1
p_columnOffset2
p_columnOffset3
p_columnOffset4
p_columnOffset5
p_columnOffset6
p_columnWidth
p_columnWidth1
p_columnWidth2
p_columnWidth3
p_columnWidth4
p_columnWidth5
p_columnWidth6
p_ct1
p_ct2
p_ct3
p_ct4
p_ct5
p_ct6
p_cw
p_cw1
p_cw2
p_cw3
p_cw4
p_cw5
p_cw6
p_defineTemplate
p_dimension
Returns:(x,y) tuple of x and y dimensions of the UI element
p_doctTag
p_dt
p_dtg
p_ebg
p_en
p_enable
p_enableBackground
p_ex
Returns:True if this instance still exists in maya
p_exists
Returns:True if this instance still exists in maya
p_fpn
p_fullPathName
p_h
p_height
p_io
p_isObscured
p_m
p_manage
p_nc
p_nch
p_npm
p_numberOfChildren
p_numberOfColumns
p_numberOfPopupMenus
p_pma
Returns:popup menus attached to this control
p_po
p_popupMenuArray
Returns:popup menus attached to this control
p_preventOverride
p_rat
p_rowAttach
p_useTemplate
p_ut
p_vis
p_visible
p_w
p_width
parent()
Returns:parent instance of this ui element
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
partition

S.partition(sep) -> (head, sep, tail)

Search for the separator sep in S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return S and two empty strings.

popupMenuArray()
Returns:popup menus attached to this control
postCheck(result)
Runs after the check has finished including the given result
preCheck()
Runs before the check starts
removeChild(child)

Remove the given child from our list

Returns:True if the child was found and has been removed, False otherwise
replace

S.replace (old, new[, count]) -> unicode

Return a copy of S with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.

rfind

S.rfind(sub [,start [,end]]) -> int

Return the highest index in S where substring sub is found, such that sub is contained within s[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex

S.rindex(sub [,start [,end]]) -> int

Like S.rfind() but raise ValueError when the substring is not found.

rjust

S.rjust(width[, fillchar]) -> unicode

Return S right-justified in a Unicode string of length width. Padding is done using the specified fill character (default is a space).

root()
Returns:the root of the DAG - it has no further parents
rpartition

S.rpartition(sep) -> (head, sep, tail)

Search for the separator sep in S, starting at the end of S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return two empty strings and S.

rsplit

S.rsplit([sep [,maxsplit]]) -> list of strings

Return a list of the words in S, using sep as the delimiter string, starting at the end of the string and working to the front. If maxsplit is given, at most maxsplit splits are done. If sep is not specified, any whitespace string is a separator.

rstrip

S.rstrip([chars]) -> unicode

Return a copy of the string S with trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is a str, it will be converted to unicode before stripping

selectPressed(*args)
Called if the selected button has been pressed Triggers a workflow run if not yet done
sender()
Returns:instance which sent the event you are currently processing
Raises ValueError:
 if no event is currently in progress
setActive()

Set this container active, such that newly created items will be children of this layout

Returns:self
Note:always use the addChild function to add the children !
setAnnotation(ann)
Set the UI element’s annotation :note: not all named UI elements can have their annotation set
setDimension(dimension)
Set the UI elements dimension :param dimension: (x,y) : tuple holding desired x and y dimension
setFocus()
Set the global keyboard focus to this control
setParentActive()

Set the parent ( layout ) of this layout active - newly created items will be children of the parent layout

Returns:self
Note:can safely be called several times
setResult(result)

Setup ourselves to indicate the given check result

Returns:our adjusted iconTextButton Member
shortName()
Returns:shortname of the ui ( name without pipes )
split

S.split([sep [,maxsplit]]) -> list of strings

Return a list of the words in S, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator and empty strings are removed from the result.

splitlines

S.splitlines([keepends]) -> list of strings

Return a list of the lines in S, breaking at line boundaries. Line breaks are not included in the resulting list unless keepends is given and true.

startswith

S.startswith(prefix[, start[, end]]) -> bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip

S.strip([chars]) -> unicode

Return a copy of the string S with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is a str, it will be converted to unicode before stripping

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
swapcase

S.swapcase() -> unicode

Return a copy of S with uppercase characters converted to lowercase and vice versa.

title

S.title() -> unicode

Return a titlecased version of S, i.e. words start with title case characters, all remaining cased characters have lower case.

translate

S.translate(table) -> unicode

Return a copy of the string S, where all characters have been mapped through the given translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, Unicode strings or None. Unmapped characters are left untouched. Characters mapped to None are deleted.

type()
Returns:the python class able to create this class
Note:The return value is NOT the type string, but a class
uiDeleted()

If overridden in subclass, it will be called once the UI gets deleted within maya ( i.e. the user closed the window )eee The base implementation assures that all event-receivers that are bound to your events will be freed, allowing them to possibly be destroyed as well.

Use this callback to register yourself from all your event senders, then call the base class method.

Note:This is not related to the __del__ method of your object. Its worth noting that your instance will be strongly bound to a maya event, hence your instance will exist as long as your user interface element exists within maya.
update()
Update ourselves to match information in our stored check
upper

S.upper() -> unicode

Return a copy of S converted to uppercase.

zfill

S.zfill(width) -> unicode

Pad a numeric string S with zeros on the left, to fill a field of the specified width. The string S is never truncated.

Epydoc: mrv.maya.ui.qa.QALayout

class mrv.maya.ui.qa.QALayout(*args, **kwargs)

Bases: mrv.maya.ui.FormLayout, mrv.maya.ui.util.iItemSet

Layout able to dynamically display QAChecks, run them and display their result

class FormConstraint

Bases: object

defines the way a child is constrained, possibly to other children

Todo:proper constraint system, but could be complicated to make it really easy to use
classmethod QALayout.activeParent()
Returns:NameUI of the currently set parent
Raises RuntimeError:
 if no active parent was set
QALayout.add(child, set_self_active=False, revert_to_previous_parent=True)

Add the given child UI item to our list of children

Parameters:
  • set_self_active – if True, we explicitly make ourselves the current parent for newly created UI elements
  • revert_to_previous_parent – if True, the previous parent will be restored once we are done, if False we keep the parent - only effective if set_self_active is True
Returns:

the newly added child, allowing contructs like button = layout.addChild( Button( ) )

classmethod QALayout.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
QALayout.annotation()
:return : the annotation string
QALayout.basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
QALayout.capitalize

S.capitalize() -> unicode

Return a capitalized version of S, i.e. make the first character have upper case.

QALayout.center

S.center(width[, fillchar]) -> unicode

Return S centered in a Unicode string of length width. Padding is done using the specified fill character (default is a space)

QALayout.checkHandler(event, check, *args)

Called for the given event - it will find the UI element handling the call respective function on the UI instance

Note:find the check using predefined names as they server as unique-enough keys. This would possibly be faster, but might not make a difference after all
QALayout.checkLayouts()
Returns:list of checkLayouts representing our checks
QALayout.checks()
Returns:list of checks we are currently holding in our layout
QALayout.checkuicls
alias of QACheckLayout
QALayout.childByName(childname)
Returns:stored child instance, specified either as short name ( without pipes ) or fully qualified ( i.e. mychild or parent|subparent|mychild” )
Raises KeyError:
 if a child with that name does not exist
QALayout.children()
Returns:children of this layout
QALayout.childrenDeep(**kwargs)
Returns:all child instances recursively
Note:the order of children is lexically ordered at this time
Note:this implementation is slow and should be overridden by more specialized subclasses
QALayout.clearAllEvents()

Remove all event receivers for all events registered in this instance.

Note:This usually doesn’t need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance
QALayout.clearChildren()
Clear our child arrays to quickly forget about our children
QALayout.count

S.count(sub[, start[, end]]) -> int

Return the number of non-overlapping occurrences of substring sub in Unicode string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

QALayout.createItem(checkid, name_to_child_map=None, name_to_check_map=None, **kwargs)

Create and return a layout displaying the given check instance

Parameter:kwargs – will be passed to checkui class’s initializer, allowing subclasses to easily adjust the paramter list
Note:its using self.checkuicls to create the instance
QALayout.currentItemIds(name_to_child_map=None, **kwargs)
Returns:current check ids as defined by exsiting children.
Note:additionally fills in the name_to_child_map
QALayout.decode

S.decode([encoding[,errors]]) -> string or unicode

Decodes S using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is ‘strict’ meaning that encoding errors raise a UnicodeDecodeError. Other possible values are ‘ignore’ and ‘replace’ as well as any other name registerd with codecs.register_error that is able to handle UnicodeDecodeErrors.

QALayout.delete()
Delete this UI - the wrapper instance must not be used after this call
QALayout.deleteChild(child)
Delete the given child ui physically so it will not be shown anymore after removing it from our list of children
QALayout.dimension()
Returns:(x,y) tuple of x and y dimensions of the UI element
QALayout.e_dgc
Event suitable to deal with user interface callback
QALayout.e_dpc
Event suitable to deal with user interface callback
QALayout.e_dragCallback
Event suitable to deal with user interface callback
QALayout.e_dropCallback
Event suitable to deal with user interface callback
QALayout.e_vcc
Event suitable to deal with user interface callback
QALayout.e_visibleChangeCommand
Event suitable to deal with user interface callback
QALayout.encode

S.encode([encoding[,errors]]) -> string or unicode

Encodes S using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

QALayout.endswith

S.endswith(suffix[, start[, end]]) -> bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

QALayout.exists()
Returns:True if this instance still exists in maya
QALayout.expandtabs

S.expandtabs([tabsize]) -> unicode

Return a copy of S where all tab characters are expanded using spaces. If tabsize is not given, a tab size of 8 characters is assumed.

QALayout.find

S.find(sub [,start [,end]]) -> int

Return the lowest index in S where substring sub is found, such that sub is contained within s[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

QALayout.format
S.format(*args, **kwargs) -> unicode
QALayout.fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
QALayout.handleEvent(eventid, **kwargs)
Assure we have the proper layouts active
QALayout.index

S.index(sub [,start [,end]]) -> int

Like S.find() but raise ValueError when the substring is not found.

QALayout.isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
QALayout.isRoot()
Returns:True if this path is the root of the DAG
QALayout.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
QALayout.isalnum

S.isalnum() -> bool

Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.

QALayout.isalpha

S.isalpha() -> bool

Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.

QALayout.isdecimal

S.isdecimal() -> bool

Return True if there are only decimal characters in S, False otherwise.

QALayout.isdigit

S.isdigit() -> bool

Return True if all characters in S are digits and there is at least one character in S, False otherwise.

QALayout.islower

S.islower() -> bool

Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.

QALayout.isnumeric

S.isnumeric() -> bool

Return True if there are only numeric characters in S, False otherwise.

QALayout.isspace

S.isspace() -> bool

Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.

QALayout.istitle

S.istitle() -> bool

Return True if S is a titlecased string and there is at least one character in S, i.e. upper- and titlecase characters may only follow uncased characters and lowercase characters only cased ones. Return False otherwise.

QALayout.isupper

S.isupper() -> bool

Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.

QALayout.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
QALayout.join

S.join(iterable) -> unicode

Return a string which is the concatenation of the strings in the iterable. The separator between elements is S.

QALayout.listChildren(predicate=<function <lambda> at 0x6063578>)
Returns:list with our child instances
Parameter:predicate – function returning True for each child to include in result, allows to easily filter children
Note:it’s a copy, so you can freely act on the list
Note:children will be returned in the order in which they have been added
classmethod QALayout.listEventNames()
Returns:list of event ids that exist on our class
QALayout.ljust

S.ljust(width[, fillchar]) -> int

Return S left-justified in a Unicode string of length width. Padding is done using the specified fill character (default is a space).

QALayout.lower

S.lower() -> unicode

Return a copy of the string S converted to lowercase.

QALayout.lstrip

S.lstrip([chars]) -> unicode

Return a copy of the string S with leading whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is a str, it will be converted to unicode before stripping

QALayout.p_ann
:return : the annotation string
QALayout.p_annotation
:return : the annotation string
QALayout.p_backgroundColor
QALayout.p_bgc
QALayout.p_ca
Returns:children of this layout
QALayout.p_childArray
Returns:children of this layout
QALayout.p_defineTemplate
QALayout.p_dimension
Returns:(x,y) tuple of x and y dimensions of the UI element
QALayout.p_doctTag
QALayout.p_dt
QALayout.p_dtg
QALayout.p_ebg
QALayout.p_en
QALayout.p_enable
QALayout.p_enableBackground
QALayout.p_ex
Returns:True if this instance still exists in maya
QALayout.p_exists
Returns:True if this instance still exists in maya
QALayout.p_fpn
QALayout.p_fullPathName
QALayout.p_h
QALayout.p_height
QALayout.p_io
QALayout.p_isObscured
QALayout.p_m
QALayout.p_manage
QALayout.p_nch
QALayout.p_npm
QALayout.p_numberOfChildren
QALayout.p_numberOfPopupMenus
QALayout.p_pma
Returns:popup menus attached to this control
QALayout.p_po
QALayout.p_popupMenuArray
Returns:popup menus attached to this control
QALayout.p_preventOverride
QALayout.p_useTemplate
QALayout.p_ut
QALayout.p_vis
QALayout.p_visible
QALayout.p_w
QALayout.p_width
QALayout.parent()
Returns:parent instance of this ui element
QALayout.parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
QALayout.partition

S.partition(sep) -> (head, sep, tail)

Search for the separator sep in S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return S and two empty strings.

QALayout.popupMenuArray()
Returns:popup menus attached to this control
QALayout.qaworkflowcls
alias of QAWorkflow
QALayout.removeChild(child)

Remove the given child from our list

Returns:True if the child was found and has been removed, False otherwise
QALayout.removeItem(checkid, name_to_child_map=None, **kwargs)
Delete the user interface portion representing the checkid
QALayout.replace

S.replace (old, new[, count]) -> unicode

Return a copy of S with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.

QALayout.rfind

S.rfind(sub [,start [,end]]) -> int

Return the highest index in S where substring sub is found, such that sub is contained within s[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

QALayout.rindex

S.rindex(sub [,start [,end]]) -> int

Like S.rfind() but raise ValueError when the substring is not found.

QALayout.rjust

S.rjust(width[, fillchar]) -> unicode

Return S right-justified in a Unicode string of length width. Padding is done using the specified fill character (default is a space).

QALayout.root()
Returns:the root of the DAG - it has no further parents
QALayout.rpartition

S.rpartition(sep) -> (head, sep, tail)

Search for the separator sep in S, starting at the end of S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return two empty strings and S.

QALayout.rsplit

S.rsplit([sep [,maxsplit]]) -> list of strings

Return a list of the words in S, using sep as the delimiter string, starting at the end of the string and working to the front. If maxsplit is given, at most maxsplit splits are done. If sep is not specified, any whitespace string is a separator.

QALayout.rstrip

S.rstrip([chars]) -> unicode

Return a copy of the string S with trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is a str, it will be converted to unicode before stripping

QALayout.runAllPressed(*args, **kwargs)

Called once the Run-All button is pressed

Parameter:kwargs – will be passed to runChecks method of workflow
Note:we assume all checks are from one workflow only as we do not sort them by workflow
Note:currently we only run in query mode as sort of safety measure - check and fix on all might be too much and lead to unexpected results
QALayout.sender()
Returns:instance which sent the event you are currently processing
Raises ValueError:
 if no event is currently in progress
QALayout.setActive()

Set this container active, such that newly created items will be children of this layout

Returns:self
Note:always use the addChild function to add the children !
QALayout.setAnnotation(ann)
Set the UI element’s annotation :note: not all named UI elements can have their annotation set
QALayout.setChecks(checks)

Set the checks this layout should display

Parameter:checks – iterable of qa checks as retrieved by checks
Raises ValueErorr:
 if one check is from a different workflow and there is a run_all button
QALayout.setDimension(dimension)
Set the UI elements dimension :param dimension: (x,y) : tuple holding desired x and y dimension
QALayout.setFocus()
Set the global keyboard focus to this control
QALayout.setItems(item_ids, **kwargs)

Set the UI to display items identified by the given item_ids

Parameters:
  • item_ids – ids behaving appropriately if put into a set
  • kwargs – passed on to the handler methods ( which are implemented by the subclass ). Use these to pass on additional data that you might want to use to keep additional information about your item ids
Note:

you are responsible for generating a list of item_ids and call this method to trigger the update

Returns:

tuple( SetOfDeletedItemIds, SetOfCreatedItemIds )

QALayout.setParentActive()

Set the parent ( layout ) of this layout active - newly created items will be children of the parent layout

Returns:self
Note:can safely be called several times
QALayout.setup(**kwargs)

Apply the given setup to the form layout, specified using kwargs

Parameter:kwargs – arguments you would set use to setup the form layout
QALayout.shortName()
Returns:shortname of the ui ( name without pipes )
QALayout.split

S.split([sep [,maxsplit]]) -> list of strings

Return a list of the words in S, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator and empty strings are removed from the result.

QALayout.splitlines

S.splitlines([keepends]) -> list of strings

Return a list of the lines in S, breaking at line boundaries. Line breaks are not included in the resulting list unless keepends is given and true.

QALayout.startswith

S.startswith(prefix[, start[, end]]) -> bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

QALayout.strip

S.strip([chars]) -> unicode

Return a copy of the string S with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is a str, it will be converted to unicode before stripping

QALayout.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
QALayout.swapcase

S.swapcase() -> unicode

Return a copy of S with uppercase characters converted to lowercase and vice versa.

QALayout.title

S.title() -> unicode

Return a titlecased version of S, i.e. words start with title case characters, all remaining cased characters have lower case.

QALayout.translate

S.translate(table) -> unicode

Return a copy of the string S, where all characters have been mapped through the given translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, Unicode strings or None. Unmapped characters are left untouched. Characters mapped to None are deleted.

QALayout.type()
Returns:the python class able to create this class
Note:The return value is NOT the type string, but a class
QALayout.uiDeleted()

If overridden in subclass, it will be called once the UI gets deleted within maya ( i.e. the user closed the window )eee The base implementation assures that all event-receivers that are bound to your events will be freed, allowing them to possibly be destroyed as well.

Use this callback to register yourself from all your event senders, then call the base class method.

Note:This is not related to the __del__ method of your object. Its worth noting that your instance will be strongly bound to a maya event, hence your instance will exist as long as your user interface element exists within maya.
QALayout.updateItem(checkid, name_to_child_map=None, **kwargs)
Update the item identified by the given checkid so that it represents the current state of the application
QALayout.upper

S.upper() -> unicode

Return a copy of S converted to uppercase.

QALayout.zfill

S.zfill(width) -> unicode

Pad a numeric string S with zeros on the left, to fill a field of the specified width. The string S is never truncated.

Epydoc: mrv.maya.ui.qa

class mrv.maya.ui.qa.QAWorkflow(*args, **kwargs)

Bases: mrv.automation.workflow.Workflow, mrv.util.EventSender

Represents a workflow of QAProcessBase instances and allows to query them more conveniently

class CallGraph

Bases: networkx.classes.digraph.DiGraph

Simple wrapper storing a call graph, keeping the root at which the call started

Note:this class is specialized to be used by workflows, its not general for that purpose
add_cycle(nlist, **attr)
add_edge(u, v, attr_dict=None, **attr)
add_edges_from(ebunch, attr_dict=None, **attr)
add_node(n, attr_dict=None, **attr)
add_nodes_from(nodes, **attr)
add_path(nlist, **attr)
add_star(nlist, **attr)
add_weighted_edges_from(ebunch, **attr)
adjacency_iter()
adjacency_list()
callRoot()
Returns:root at which the call started
callstackSize()
Returns:length of the callstack
clear()
copy()
degree(nbunch=None, with_labels=False, weighted=False)
degree_iter(nbunch=None, weighted=False)
edges(nbunch=None, data=False)
edges_iter(nbunch=None, data=False)
endCall(result)

End the call start started previously

Parameter:result – the result of the call
get_edge_data(u, v, default=None)
has_edge(u, v)
has_node(n)
has_predecessor(u, v)
has_successor(u, v)
in_degree(nbunch=None, with_labels=False, weighted=False)
in_degree_iter(nbunch=None, weighted=False)
in_edges(nbunch=None, data=False)
in_edges_iter(nbunch=None, data=False)
is_directed()
is_multigraph()
nbunch_iter(nbunch=None)
neighbors(n)
neighbors_iter(n)
nodes(data=False)
nodes_iter(data=False)
nodes_with_selfloops()
number_of_edges(u=None, v=None)
number_of_nodes()
number_of_selfloops()
order()
out_degree(nbunch=None, with_labels=False, weighted=False)
out_degree_iter(nbunch=None, weighted=False)
out_edges(nbunch=None, data=False)
out_edges_iter(nbunch=None, data=False)
predecessors(n)
predecessors_iter(n)
remove_edge(u, v)
remove_edges_from(ebunch)
remove_node(n)
remove_nodes_from(nbunch)
reverse(copy=True)
selfloop_edges(data=False)
size(weighted=False)
startCall(pdata)
Add a call of a process
subgraph(nbunch, copy=True)
successors(n)
successors_iter(n)
toCallList(reverse=True, pruneIfTrue=<function <lambda> at 0x3445f50>)
Returns:

flattened version of graph as list of ProcessData edges in call order , having the root as last element of the list

Parameters:
  • pruneIfTrue – Function taking ProcessData to return true if the node should be pruned from the result
  • reverse – if true, the calllist will be properly reversed ( taking childre into account
to_directed()
to_undirected()
class QAWorkflow.ProcessData(process, plug, mode)

Bases: object

Allows to store additional information with each process called during the workflow

elapsed()
Returns:time to process the call
endtime
exception
index
mode
plug
process
result()
Returns:result stored in this instance, or None if it is not present or not alive
setResult(result)

Set the given result

Note:uses weak references as the tracking structure should not cause a possible mutation of the program flow ( as instances stay alive although code expects it to be deleted
starttime
QAWorkflow.addNode(node)
Add a new node instance to the graph :note: node membership is exclusive, thus node instances can only be in one graph at a time :return: self, for chained calls
classmethod QAWorkflow.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
QAWorkflow.add_cycle(nlist, **attr)
QAWorkflow.add_edge(u, v, attr_dict=None, **attr)
QAWorkflow.add_edges_from(ebunch, attr_dict=None, **attr)
QAWorkflow.add_node(n, attr_dict=None, **attr)
QAWorkflow.add_nodes_from(nodes, **attr)
QAWorkflow.add_path(nlist, **attr)
QAWorkflow.add_star(nlist, **attr)
QAWorkflow.add_weighted_edges_from(ebunch, **attr)
QAWorkflow.adjacency_iter()
QAWorkflow.adjacency_list()
QAWorkflow.basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
QAWorkflow.callgraph()
Returns:current callgraph instance
Note:its strictly read-only and may not be changed
QAWorkflow.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
QAWorkflow.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

QAWorkflow.clear()
QAWorkflow.clearAllEvents()

Remove all event receivers for all events registered in this instance.

Note:This usually doesn’t need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance
QAWorkflow.clearCache()
Clear the cache of all nodes in the graph - this forces the graph to reevaluate on the next request
QAWorkflow.connect(sourceshell, destinationshell, force=False)

Connect this plug to destinationshell such that destinationshell is an input plug for our output

Parameters:
  • sourceshell – PlugShell being source of the connection
  • destinationshell – PlugShell being destination of the connection
  • force – if False, existing connections to destinationshell will not be broken, but an exception is raised if True, existing connection may be broken
Returns:

self on success, allows chained connections

Raises PlugAlreadyConnected:
 

if destinationshell is connected and force is False

Raises PlugIncompatible:
 

if destinationshell does not appear to be compatible to this one

QAWorkflow.copy()
QAWorkflow.copyFrom(other)
Only mode is required
QAWorkflow.copyTo(instance, *args, **kwargs)

Copy the values of ourselves onto the given instance which must be an instance of our class to be compatible. Only the common classes will be copied to instance

Returns:altered instance
Note:instance will be altered during the process
QAWorkflow.copyToOther(instance, *args, **kwargs)
As copyTo, but does only require the objects to have a common base. It will match the actually compatible base classes and call copyFrom if possible. As more checking is performed, this method performs worse than copyTo
QAWorkflow.createInstance()
Create a copy of self and return it
QAWorkflow.createReportInstance(reportType)

Create a report instance that describes how the previous target was made

Parameter:reportType – Report to populate with information - it must be a Plan based class that can be instantiated and populated with call information. A report analyses the call dependency graph generated during dg evaluation and presents it.
Returns:report instance whose makeReport method can be called to retrieve it
QAWorkflow.degree(nbunch=None, with_labels=False, weighted=False)
QAWorkflow.degree_iter(nbunch=None, weighted=False)
QAWorkflow.disconnect(sourceshell, destinationshell)
Remove the connection between sourceshell to destinationshell if they are connected :note: does not raise if no connection is present
QAWorkflow.duplicate(*args, **kwargs)

Implements a c-style copy constructor by creating a new instance of self and applying the copyFrom methods from base to all classes implementing the copyfrom method. Thus we will call the method directly on the class

Parameters:
  • args – passed to copyFrom and createInstance method to give additional directions
  • kwargs – see param args
QAWorkflow.e_checkError
Descriptor allowing to easily setup callbacks for classes derived from EventSender
QAWorkflow.e_postCheck
Descriptor allowing to easily setup callbacks for classes derived from EventSender
QAWorkflow.e_preCheck
Descriptor allowing to easily setup callbacks for classes derived from EventSender
QAWorkflow.edges(nbunch=None, data=False)
QAWorkflow.edges_iter(nbunch=None, data=False)
static QAWorkflow.fIsQAPlug(p)
static QAWorkflow.fIsQAProcessBase(n)
QAWorkflow.filterChecks(processes, predicate=<function <lambda> at 0x345fd70>)

As listChecks, but allows you do define the processes to use

Parameter:predicate – func( p ) for plug p returns True for it to be included in the result
QAWorkflow.fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
QAWorkflow.get_edge_data(u, v, default=None)
QAWorkflow.hasNode(node)
Returns:True if the node is in this graph, false otherwise
QAWorkflow.has_edge(u, v)
QAWorkflow.has_node(n)
QAWorkflow.has_predecessor(u, v)
QAWorkflow.has_successor(u, v)
QAWorkflow.in_degree(nbunch=None, with_labels=False, weighted=False)
QAWorkflow.in_degree_iter(nbunch=None, weighted=False)
QAWorkflow.in_edges(nbunch=None, data=False)
QAWorkflow.in_edges_iter(nbunch=None, data=False)
QAWorkflow.input(plugshell)
Returns:the connected input plug of plugshell or None if there is no such connection
Note:input plugs have on plug at most, output plugs can have more than one connected plug
QAWorkflow.isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
QAWorkflow.isRoot()
Returns:True if this path is the root of the DAG
QAWorkflow.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
QAWorkflow.is_directed()
QAWorkflow.is_multigraph()
QAWorkflow.iterConnectedNodes(predicate=<function <lambda> at 0x2ed0aa0>)
Returns:generator returning all nodes that are connected in this graph, in no particular order. For an ordered itereration, use iterShells.
Parameter:predicate – if True for node, it will be returned
QAWorkflow.iterNodes(predicate=<function <lambda> at 0x2ed09b0>)
Returns:generator returning all nodes in this graph
Parameter:predicate – if True for node, it will be returned
Note:there is no particular order
QAWorkflow.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
QAWorkflow.listChecks(predicate=<function <lambda> at 0x345fe60>)

List all checks as supported by QAProcessBase es in this QA Workflow

Parameter:predicate – include check c in result if func( c ) returns True
classmethod QAWorkflow.listEventNames()
Returns:list of event ids that exist on our class
QAWorkflow.listQAProcessBasees(predicate=<function <lambda> at 0x345fc80>)
Returns:list( Process, ... ) list of QA Processes known to this QA Workflow
Parameter:predicate – include process p in result if func( p ) returns True
QAWorkflow.makeDirtyReport(target, mode='single')
Returns:

list of tuple( shell, DirtyReport|None ) If a process ( shell.node ) is dirty, a dirty report will be given explaining why the process is dirty and needs an update

Parameters:
  • target – target you which to check for it’s dirty state
  • mode
    • single - only the process assigned to evaluate target will be checked
    • multi - as single, but the whole callgraph will be checked, starting
      at the first node, stepping down the callgraph. This gives a per node dirty report.
    • deep - try to evaluate target, but fail if one process in the target’s
      call history is dirty
QAWorkflow.makeTarget(target)
Parameter:target – target to make - can be class or instance
Returns:result when producing the target
QAWorkflow.makeTargets(targetList, errstream=None, donestream=None)

batch module compatible method allowing to make mutliple targets at once

Parameters:
  • targetList – iterable providing the targets to make
  • errstream – object with file interface allowing to log errors that occurred during operation
  • donestream – if list, targets successfully done will be appended to it, if it is a stream, the string representation will be wrtten to it
QAWorkflow.nbunch_iter(nbunch=None)
QAWorkflow.neighbors(n)
QAWorkflow.neighbors_iter(n)
QAWorkflow.nodeByID(nodeID)
Returns:instance of a node according to the given node id
Raises NameError:
 if no such node exists in graph
QAWorkflow.nodes()
Returns:immutable copy of the nodes used in the graph
QAWorkflow.nodes_iter(data=False)
QAWorkflow.nodes_with_selfloops()
QAWorkflow.numNodes()
Returns:number of nodes in the graph
QAWorkflow.number_of_edges(u=None, v=None)
QAWorkflow.number_of_nodes()
QAWorkflow.number_of_selfloops()
QAWorkflow.order()
QAWorkflow.out_degree(nbunch=None, with_labels=False, weighted=False)
QAWorkflow.out_degree_iter(nbunch=None, weighted=False)
QAWorkflow.out_edges(nbunch=None, data=False)
QAWorkflow.out_edges_iter(nbunch=None, data=False)
QAWorkflow.outputs(plugshell, predicate=<function <lambda> at 0x2ed0e60>)
Returns:a list of plugs being the destination of the connection to plugshell
Parameter:predicate – plug will only be returned if predicate is true for it - shells will be passed in
QAWorkflow.parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
QAWorkflow.parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
QAWorkflow.predecessors(n)
QAWorkflow.predecessors_iter(n)
QAWorkflow.removeNode(node)
Remove the given node from the graph ( if it exists in it )
QAWorkflow.remove_edge(u, v)
QAWorkflow.remove_edges_from(ebunch)
QAWorkflow.remove_node(n)
QAWorkflow.remove_nodes_from(nbunch)
QAWorkflow.reverse(copy=True)
QAWorkflow.root()
Returns:the root of the DAG - it has no further parents
QAWorkflow.runChecks(checks, mode=query, clear_result=True)

Run the given checks in the given mode and return their results

Parameters:
  • checks – list( QACheckShell, ... ) as retrieved by listChecks
  • modeQAProcessBase.eMode
  • clear_result – if True, the plug’s cache will be removed forcing a computation if False, you might get a cached value depending on the plug’s setup
Returns:

list( tuple( QACheckShell, QACheckResult ), ... ) list of pairs of QACheckShells and the check’s result. The test result will be empty if the test did not run or failed with an exception

Note:

Sends the following events: e_preCheck , e_postCheck, e_checkError e_checkError may set the abort_on_error variable to True to cause the operation not to proceed with other checks

QAWorkflow.selfloop_edges(data=False)
QAWorkflow.sender()
Returns:instance which sent the event you are currently processing
Raises ValueError:
 if no event is currently in progress
QAWorkflow.size(weighted=False)
QAWorkflow.subgraph(nbunch, copy=True)
QAWorkflow.successors(n)
QAWorkflow.successors_iter(n)
QAWorkflow.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
QAWorkflow.targetRating(target)
Returns:

int range(0,255) indicating how well a target can be made 0 means not at all, 255 means perfect.

Return value is tuple ( rate, PlugShell ), containing the process and plug with the highest rating or None if rate is 0

Walk the dependency graph such that leaf nodes have higher ratings than non-leaf nodes

Note:

you can use the process.ProcessBase enumeration for comparison

QAWorkflow.targetSupportList()
Returns:list of all supported target type
Note:this method is for informational purposes only
QAWorkflow.to_directed()
QAWorkflow.to_undirected()
QAWorkflow.writeDot(fileOrPath)
Write the connections in self to the given file object or path :todo: remove if no longer needed

Epydoc: mrv.maya.ui.qa

class mrv.maya.ui.qa.chain

Bases: object

chain(*iterables) –> chain object

Return a chain object whose .next() method returns elements from the first iterable until it is exhausted, then elements from the next iterable, until all of the iterables are exhausted.

static from_iterable()

chain.from_iterable(iterable) –> chain object

Alternate chain() contructor taking a single iterable argument that evaluates lazily.

next
x.next() -> the next value, or raise StopIteration

Table Of Contents

Previous topic

mrv.maya.ui.control

Next topic

mrv.maya.ui.browse.layout

This Page