<s> """<STR_LIT>""" <EOL> import re , sys , functools , traceback <EOL> import pymel . util as _util <EOL> import pymel . internal . pmcmds as cmds <EOL> import pymel . internal . factories as _factories <EOL> import pymel . internal as _internal <EOL> import pymel . versions as _versions <EOL> from language import mel , melGlobals <EOL> from system import Path as _Path <EOL> _logger = _internal . getLogger ( __name__ ) <EOL> _thisModule = sys . modules [ __name__ ] <EOL> thisModuleCmd = "<STR_LIT>" % ( __name__ , __name__ ) <EOL> def _lsUI ( ** kwargs ) : <EOL> long = kwargs . pop ( '<STR_LIT>' , kwargs . pop ( '<STR_LIT:l>' , True ) ) <EOL> head = kwargs . pop ( '<STR_LIT>' , kwargs . pop ( '<STR_LIT>' , None ) ) <EOL> tail = kwargs . pop ( '<STR_LIT>' , kwargs . pop ( '<STR_LIT>' , None ) ) <EOL> if not kwargs : <EOL> kwargs = { <EOL> '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:0> , '<STR_LIT>' : <NUM_LIT:1> <EOL> } <EOL> kwargs [ '<STR_LIT>' ] = long <EOL> if head is not None : kwargs [ '<STR_LIT>' ] = head <EOL> if tail is not None : kwargs [ '<STR_LIT>' ] = tail <EOL> return _util . listForNone ( cmds . lsUI ( ** kwargs ) ) <EOL> _commandsToUITypes = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def _findLongName ( name , type = None ) : <EOL> kwargs = { '<STR_LIT>' : True } <EOL> if type : <EOL> kwargs [ '<STR_LIT:type>' ] = _commandsToUITypes . get ( type , type ) <EOL> uiObjs = _util . listForNone ( _lsUI ( ** kwargs ) ) <EOL> res = [ x for x in uiObjs if x . endswith ( '<STR_LIT:|>' + name ) ] <EOL> if len ( res ) > <NUM_LIT:1> : <EOL> raise ValueError , "<STR_LIT>" % name <EOL> elif len ( res ) == <NUM_LIT:0> : <EOL> raise ValueError , "<STR_LIT>" % name <EOL> return res [ <NUM_LIT:0> ] <EOL> def lsUI ( ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> import uitypes <EOL> return [ uitypes . PyUI ( x ) for x in _lsUI ( ** kwargs ) ] <EOL> scriptTableCmds = { } <EOL> def scriptTable ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> import uitypes <EOL> cb = kwargs . pop ( '<STR_LIT>' , kwargs . pop ( '<STR_LIT>' , None ) ) <EOL> cc = kwargs . pop ( '<STR_LIT>' , kwargs . pop ( '<STR_LIT>' , None ) ) <EOL> uiName = cmds . scriptTable ( * args , ** kwargs ) <EOL> if "<STR_LIT:q>" in kwargs or "<STR_LIT>" in kwargs : <EOL> return uiName <EOL> kwargs . clear ( ) <EOL> if cb : <EOL> if hasattr ( cb , '<STR_LIT>' ) : <EOL> procName = '<STR_LIT>' % len ( scriptTableCmds . keys ( ) ) <EOL> key = '<STR_LIT>' % ( uiName , procName ) <EOL> procCmd = """<STR_LIT>""" % ( procName , thisModuleCmd , key ) <EOL> mel . eval ( procCmd ) <EOL> scriptTableCmds [ key ] = cb <EOL> cmds . scriptJob ( uiDeleted = ( uiName , lambda * x : scriptTableCmds . pop ( key , None ) ) ) <EOL> cb = procName <EOL> kwargs [ '<STR_LIT>' ] = cb <EOL> if cc : <EOL> if hasattr ( cc , '<STR_LIT>' ) : <EOL> procName = '<STR_LIT>' % len ( scriptTableCmds . keys ( ) ) <EOL> key = '<STR_LIT>' % ( uiName , procName ) <EOL> procCmd = """<STR_LIT>""" % ( procName , thisModuleCmd , key ) <EOL> mel . eval ( procCmd ) <EOL> scriptTableCmds [ key ] = cc <EOL> cmds . scriptJob ( uiDeleted = ( uiName , lambda * x : scriptTableCmds . pop ( key , None ) ) ) <EOL> cc = procName <EOL> kwargs [ '<STR_LIT>' ] = cc <EOL> if kwargs : <EOL> cmds . scriptTable ( uiName , e = <NUM_LIT:1> , ** kwargs ) <EOL> return uitypes . ScriptTable ( uiName ) <EOL> def getPanel ( * args , ** kwargs ) : <EOL> typeOf = kwargs . pop ( '<STR_LIT>' , kwargs . pop ( '<STR_LIT:to>' , None ) ) <EOL> if typeOf : <EOL> kwargs [ '<STR_LIT>' ] = typeOf . rsplit ( '<STR_LIT:|>' , <NUM_LIT:1> ) [ - <NUM_LIT:1> ] <EOL> return cmds . getPanel ( * args , ** kwargs ) <EOL> class BaseCallback ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , func , * args , ** kwargs ) : <EOL> self . func = func <EOL> self . args = args <EOL> self . kwargs = kwargs <EOL> self . traceback = traceback . format_stack ( ) <EOL> if _versions . current ( ) >= _versions . v2009 : <EOL> class Callback ( BaseCallback ) : <EOL> """<STR_LIT>""" <EOL> def __call__ ( self , * args ) : <EOL> cmds . undoInfo ( openChunk = <NUM_LIT:1> ) <EOL> try : <EOL> try : <EOL> return self . func ( * self . args , ** self . kwargs ) <EOL> except Exception , e : <EOL> raise _factories . CallbackError ( self , e ) <EOL> finally : <EOL> cmds . undoInfo ( closeChunk = <NUM_LIT:1> ) <EOL> class CallbackWithArgs ( Callback ) : <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> kwargsFinal = self . kwargs . copy ( ) <EOL> kwargsFinal . update ( kwargs ) <EOL> cmds . undoInfo ( openChunk = <NUM_LIT:1> ) <EOL> try : <EOL> try : <EOL> return self . func ( * self . args + args , ** kwargsFinal ) <EOL> except Exception , e : <EOL> raise _factories . CallbackError ( self , e ) <EOL> finally : <EOL> cmds . undoInfo ( closeChunk = <NUM_LIT:1> ) <EOL> else : <EOL> class Callback ( BaseCallback ) : <EOL> """<STR_LIT>""" <EOL> _callData = None <EOL> @ staticmethod <EOL> def _doCall ( ) : <EOL> ( func , args , kwargs ) = Callback . _callData <EOL> Callback . _callData = func ( * args , ** kwargs ) <EOL> def __call__ ( self , * args ) : <EOL> Callback . _callData = ( self . func , self . args , self . kwargs ) <EOL> try : <EOL> mel . python ( "<STR_LIT>" % thisModuleCmd ) <EOL> except Exception , e : <EOL> raise _factories . CallbackError ( self . func , e ) <EOL> return Callback . _callData <EOL> class CallbackWithArgs ( Callback ) : <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> kwargsFinal = self . kwargs . copy ( ) <EOL> kwargsFinal . update ( kwargs ) <EOL> Callback . _callData = ( self . func , self . args + args , kwargsFinal ) <EOL> try : <EOL> mel . python ( "<STR_LIT>" % thisModuleCmd ) <EOL> except Exception , e : <EOL> raise _factories . CallbackError ( self . func , e ) <EOL> return Callback . _callData <EOL> def verticalLayout ( * args , ** kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> return autoLayout ( * args , ** kwargs ) <EOL> def horizontalLayout ( * args , ** kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> return autoLayout ( * args , ** kwargs ) <EOL> def promptBox ( title , message , okText , cancelText , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> ret = promptDialog ( t = title , m = message , b = [ okText , cancelText ] , db = okText , cb = cancelText , ** kwargs ) <EOL> if ret == okText : <EOL> return promptDialog ( q = <NUM_LIT:1> , tx = <NUM_LIT:1> ) <EOL> def promptBoxGenerator ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> while <NUM_LIT:1> : <EOL> ret = promptBox ( * args , ** kwargs ) <EOL> if not ret : return <EOL> yield ret <EOL> def confirmBox ( title , message , yes = "<STR_LIT>" , no = "<STR_LIT>" , * moreButtons , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> default = kwargs . get ( "<STR_LIT>" , kwargs . get ( "<STR_LIT>" ) ) or yes <EOL> ret = confirmDialog ( t = title , m = message , b = [ yes , no ] + list ( moreButtons ) , <EOL> db = default , <EOL> ma = "<STR_LIT>" , cb = no , ds = no ) <EOL> if moreButtons : <EOL> return ret <EOL> else : <EOL> return ( ret == yes ) <EOL> def informBox ( title , message , ok = "<STR_LIT>" ) : <EOL> """<STR_LIT>""" <EOL> confirmDialog ( t = title , m = message , b = [ ok ] , db = ok ) <EOL> class PopupError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __new__ ( cls , msgOrException , title = '<STR_LIT>' , button = '<STR_LIT>' , msg = None , <EOL> icon = '<STR_LIT>' ) : <EOL> if not isinstance ( msgOrException , ( basestring , Exception ) ) : <EOL> raise TypeError ( msgOrException ) <EOL> if not cmds . about ( batch = <NUM_LIT:1> ) : <EOL> if not isinstance ( msgOrException , Exception ) : <EOL> msg = msgOrException <EOL> elif msg is None : <EOL> args = getattr ( msgOrException , '<STR_LIT:args>' , [ ] ) <EOL> if args : <EOL> msg = args [ <NUM_LIT:0> ] <EOL> else : <EOL> msg = '<STR_LIT>' <EOL> confirmDialog ( title = title , message = msg , button = button , icon = icon ) <EOL> if isinstance ( msgOrException , Exception ) : <EOL> return msgOrException <EOL> else : <EOL> return super ( PopupError , cls ) . __new__ ( cls , msgOrException ) <EOL> def __init__ ( self , msg , * args , ** kwargs ) : <EOL> super ( PopupError , self ) . __init__ ( msg ) <EOL> def promptForFolder ( ) : <EOL> """<STR_LIT>""" <EOL> folder = [ None ] <EOL> def getfolder ( * args ) : <EOL> folder [ <NUM_LIT:0> ] = args [ <NUM_LIT:0> ] <EOL> ret = cmds . fileBrowserDialog ( m = <NUM_LIT:4> , fc = getfolder , an = "<STR_LIT>" ) <EOL> folder = _Path ( folder [ <NUM_LIT:0> ] ) <EOL> if folder . exists ( ) : <EOL> return folder <EOL> def promptForPath ( ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if cmds . about ( linux = <NUM_LIT:1> ) : <EOL> return _Path ( fileDialog ( ** kwargs ) ) <EOL> else : <EOL> folder = [ None ] <EOL> def getfolder ( * args ) : <EOL> folder [ <NUM_LIT:0> ] = args [ <NUM_LIT:0> ] <EOL> kwargs . pop ( '<STR_LIT>' , None ) <EOL> kwargs [ '<STR_LIT>' ] = getfolder <EOL> if '<STR_LIT>' not in kwargs : <EOL> kwargs [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> kwargs [ '<STR_LIT>' ] = kwargs . pop ( '<STR_LIT>' , kwargs . pop ( '<STR_LIT>' , "<STR_LIT>" ) ) <EOL> ret = cmds . fileBrowserDialog ( ** kwargs ) <EOL> folder = _Path ( folder [ <NUM_LIT:0> ] ) <EOL> if folder : <EOL> return folder <EOL> def fileDialog ( * args , ** kwargs ) : <EOL> ret = cmds . fileDialog ( * args , ** kwargs ) <EOL> if ret : <EOL> return _Path ( ret ) <EOL> def showsHourglass ( func ) : <EOL> """<STR_LIT>""" <EOL> def decoratedFunc ( * args , ** kwargs ) : <EOL> cmds . waitCursor ( st = True ) <EOL> try : <EOL> return func ( * args , ** kwargs ) <EOL> finally : <EOL> cmds . waitCursor ( st = False ) <EOL> decoratedFunc . __doc__ = func . __doc__ <EOL> decoratedFunc . __name__ = func . __name__ <EOL> decoratedFunc . __module__ = func . __module__ <EOL> return decoratedFunc <EOL> def pathButtonGrp ( name = None , * args , ** kwargs ) : <EOL> import uitypes <EOL> if name is None or not cmds . textFieldButtonGrp ( name , ex = <NUM_LIT:1> ) : <EOL> create = True <EOL> else : <EOL> create = False <EOL> return uitypes . PathButtonGrp ( name = name , create = create , * args , ** kwargs ) <EOL> def folderButtonGrp ( name = None , * args , ** kwargs ) : <EOL> import uitypes <EOL> if name is None or not cmds . textFieldButtonGrp ( name , ex = <NUM_LIT:1> ) : <EOL> create = True <EOL> else : <EOL> create = False <EOL> return uitypes . FolderButtonGrp ( name = name , create = create , * args , ** kwargs ) <EOL> def vectorFieldGrp ( * args , ** kwargs ) : <EOL> import uitypes <EOL> return uitypes . VectorFieldGrp ( * args , ** kwargs ) <EOL> def uiTemplate ( name = None , force = False , exists = None ) : <EOL> import uitypes <EOL> if exists : <EOL> return cmds . uiTemplate ( name , exists = <NUM_LIT:1> ) <EOL> else : <EOL> return uitypes . UITemplate ( name = name , force = force ) <EOL> def setParent ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> import uitypes <EOL> result = cmds . setParent ( * args , ** kwargs ) <EOL> if kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT:q>' , False ) : <EOL> if result == '<STR_LIT>' : <EOL> result = None <EOL> else : <EOL> result = uitypes . PyUI ( result ) <EOL> return result <EOL> def currentParent ( ) : <EOL> "<STR_LIT>" <EOL> return setParent ( q = <NUM_LIT:1> ) <EOL> def currentMenuParent ( ) : <EOL> "<STR_LIT>" <EOL> return setParent ( q = <NUM_LIT:1> , menu = <NUM_LIT:1> ) <EOL> def menu ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if _versions . current ( ) < _versions . v2011 : <EOL> if not ( kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT:q>' , False ) ) and not ( kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT:e>' , False ) ) and not ( kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT:p>' , False ) ) : <EOL> kwargs [ '<STR_LIT>' ] = cmds . setParent ( q = <NUM_LIT:1> ) <EOL> if ( kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT:q>' , False ) ) and ( kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT:p>' , False ) ) : <EOL> name = unicode ( args [ <NUM_LIT:0> ] ) <EOL> if '<STR_LIT:|>' not in name : <EOL> try : <EOL> name = _findLongName ( name , '<STR_LIT>' ) <EOL> except ValueError : <EOL> name = _findLongName ( name , '<STR_LIT>' ) <EOL> return name . rsplit ( '<STR_LIT:|>' , <NUM_LIT:1> ) [ <NUM_LIT:0> ] <EOL> result = cmds . menu ( * args , ** kwargs ) <EOL> if ( kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT:q>' , False ) ) and ( kwargs . get ( '<STR_LIT>' , False ) or kwargs . get ( '<STR_LIT>' , False ) ) and result is None : <EOL> result = [ ] <EOL> return result <EOL> def _createClassCommands ( ) : <EOL> def createCallback ( classname ) : <EOL> """<STR_LIT>""" <EOL> def callback ( * args , ** kwargs ) : <EOL> import uitypes <EOL> res = getattr ( uitypes , classname ) ( * args , ** kwargs ) <EOL> return res <EOL> return callback <EOL> for funcName in _factories . uiClassList : <EOL> classname = _util . capitalize ( funcName ) <EOL> func = _factories . functionFactory ( funcName , createCallback ( classname ) , _thisModule , uiWidget = True ) <EOL> if func : <EOL> func . __module__ = __name__ <EOL> setattr ( _thisModule , funcName , func ) <EOL> def _createOtherCommands ( ) : <EOL> moduleShortName = __name__ . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] <EOL> nonClassFuncs = set ( _factories . moduleCmds [ moduleShortName ] ) . difference ( _factories . uiClassList ) <EOL> for funcName in nonClassFuncs : <EOL> func = _factories . functionFactory ( funcName , returnFunc = None , module = _thisModule ) <EOL> if func : <EOL> func . __module__ = __name__ <EOL> setattr ( _thisModule , funcName , func ) <EOL> if sys . modules [ __name__ ] != _thisModule : <EOL> setattr ( sys . modules [ __name__ ] , funcName , func ) <EOL> _createClassCommands ( ) <EOL> _createOtherCommands ( ) <EOL> def autoLayout ( * args , ** kwargs ) : <EOL> import uitypes <EOL> return uitypes . AutoLayout ( * args , ** kwargs ) <EOL> autoLayout . __doc__ = formLayout . __doc__ <EOL> def subMenuItem ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> kwargs [ '<STR_LIT>' ] = True <EOL> return menuItem ( * args , ** kwargs ) <EOL> def valueControlGrp ( name = None , create = False , dataType = None , slider = True , value = None , numberOfControls = <NUM_LIT:1> , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> import uitypes <EOL> def makeGetter ( ctrl , methodName , num ) : <EOL> def getter ( ) : <EOL> res = [ ] <EOL> for i in range ( num ) : <EOL> res . append ( getattr ( ctrl , methodName + str ( i + <NUM_LIT:1> ) ) ( ) ) <EOL> return res <EOL> return getter <EOL> def makeSetter ( ctrl , methodName , num ) : <EOL> def setter ( args ) : <EOL> for i in range ( num ) : <EOL> getattr ( ctrl , methodName + str ( i + <NUM_LIT:1> ) ) ( args [ i ] ) <EOL> return setter <EOL> sliderArgs = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> fieldArgs = [ '<STR_LIT>' , '<STR_LIT:f>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> fieldSliderArgs = [ '<STR_LIT>' , '<STR_LIT:s>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] + sliderArgs + fieldArgs <EOL> floatFieldArgs = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> verticalArgs = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> if uitypes . PyUI . _isBeingCreated ( name , create , kwargs ) : <EOL> assert dataType , "<STR_LIT>" <EOL> if not isinstance ( dataType , basestring ) : <EOL> try : <EOL> dataType = dataType . __name__ <EOL> except AttributeError : <EOL> dataType = str ( dataType ) <EOL> try : <EOL> buf = re . split ( '<STR_LIT>' , dataType ) <EOL> dataType = buf [ <NUM_LIT:0> ] <EOL> numberOfControls = int ( buf [ <NUM_LIT:1> ] ) <EOL> except : <EOL> pass <EOL> else : <EOL> dataType = control ( name , q = <NUM_LIT:1> , docTag = <NUM_LIT:1> ) <EOL> assert dataType <EOL> numberOfControls = int ( numberOfControls ) <EOL> if numberOfControls < <NUM_LIT:1> : <EOL> numberOfControls = <NUM_LIT:1> <EOL> elif numberOfControls > <NUM_LIT:4> : <EOL> numberOfControls = <NUM_LIT:4> <EOL> kwargs . pop ( '<STR_LIT>' , None ) <EOL> kwargs [ '<STR_LIT>' ] = dataType <EOL> if dataType in [ "<STR_LIT:bool>" ] : <EOL> if numberOfControls > <NUM_LIT:1> : <EOL> kwargs . pop ( '<STR_LIT>' , None ) <EOL> kwargs [ '<STR_LIT>' ] = numberOfControls <EOL> for arg in fieldSliderArgs + floatFieldArgs : <EOL> kwargs . pop ( arg , None ) <EOL> label = kwargs . get ( '<STR_LIT:label>' , kwargs . get ( '<STR_LIT:l>' , None ) ) <EOL> if label is not None : <EOL> if _util . isIterable ( label ) : <EOL> label , labelArray = label <EOL> kwargs . pop ( '<STR_LIT:l>' , None ) <EOL> kwargs [ '<STR_LIT:label>' ] = label <EOL> kwargs [ '<STR_LIT>' + str ( numberOfControls ) ] = labelArray <EOL> ctrl = uitypes . CheckBoxGrp ( name , create , ** kwargs ) <EOL> if numberOfControls > <NUM_LIT:1> : <EOL> getter = makeGetter ( ctrl , '<STR_LIT>' , numberOfControls ) <EOL> setter = makeSetter ( ctrl , '<STR_LIT>' , numberOfControls ) <EOL> else : <EOL> getter = ctrl . getValue1 <EOL> setter = ctrl . setValue1 <EOL> elif dataType in [ "<STR_LIT:int>" ] : <EOL> if numberOfControls > <NUM_LIT:1> : <EOL> kwargs . pop ( '<STR_LIT>' , None ) <EOL> kwargs [ '<STR_LIT>' ] = numberOfControls <EOL> slider = False <EOL> if slider : <EOL> for arg in floatFieldArgs + verticalArgs : <EOL> kwargs . pop ( arg , None ) <EOL> if '<STR_LIT>' not in kwargs and '<STR_LIT:f>' not in kwargs : <EOL> kwargs [ '<STR_LIT>' ] = True <EOL> ctrl = uitypes . IntSliderGrp ( name , create , ** kwargs ) <EOL> getter = ctrl . getValue <EOL> setter = ctrl . setValue <EOL> else : <EOL> for arg in fieldSliderArgs + floatFieldArgs + verticalArgs : <EOL> kwargs . pop ( arg , None ) <EOL> ctrl = uitypes . IntFieldGrp ( name , create , ** kwargs ) <EOL> getter = ctrl . getValue1 <EOL> setter = ctrl . setValue1 <EOL> elif dataType in [ "<STR_LIT:float>" ] : <EOL> if numberOfControls > <NUM_LIT:1> : <EOL> kwargs . pop ( '<STR_LIT>' , None ) <EOL> kwargs [ '<STR_LIT>' ] = numberOfControls <EOL> slider = False <EOL> if slider : <EOL> for arg in verticalArgs : <EOL> kwargs . pop ( arg , None ) <EOL> if '<STR_LIT>' not in kwargs and '<STR_LIT:f>' not in kwargs : <EOL> kwargs [ '<STR_LIT>' ] = True <EOL> ctrl = uitypes . FloatSliderGrp ( name , create , ** kwargs ) <EOL> getter = ctrl . getValue <EOL> setter = ctrl . setValue <EOL> else : <EOL> for arg in fieldSliderArgs + verticalArgs : <EOL> kwargs . pop ( arg , None ) <EOL> ctrl = uitypes . FloatFieldGrp ( name , create , ** kwargs ) <EOL> getter = ctrl . getValue1 <EOL> setter = ctrl . setValue1 <EOL> elif dataType in [ "<STR_LIT>" , "<STR_LIT>" ] : <EOL> for arg in fieldSliderArgs + floatFieldArgs + verticalArgs : <EOL> kwargs . pop ( arg , None ) <EOL> ctrl = VectorFieldGrp ( name , create , ** kwargs ) <EOL> getter = ctrl . getVector <EOL> setter = ctrl . setValue1 <EOL> elif dataType in [ "<STR_LIT:path>" , "<STR_LIT>" , "<STR_LIT>" ] : <EOL> for arg in fieldSliderArgs + floatFieldArgs + verticalArgs : <EOL> kwargs . pop ( arg , None ) <EOL> ctrl = PathButtonGrp ( name , create , ** kwargs ) <EOL> getter = ctrl . getPath <EOL> setter = ctrl . setPath <EOL> elif dataType in [ "<STR_LIT:string>" , "<STR_LIT>" , "<STR_LIT:str>" ] : <EOL> for arg in fieldSliderArgs + floatFieldArgs + verticalArgs : <EOL> kwargs . pop ( arg , None ) <EOL> ctrl = uitypes . TextFieldGrp ( name , create , ** kwargs ) <EOL> getter = ctrl . getText <EOL> setter = ctrl . setText <EOL> else : <EOL> raise TypeError , "<STR_LIT>" % dataType <EOL> ctrl . getValue = getter <EOL> ctrl . setValue = setter <EOL> ctrl . dataType = ctrl . getDocTag <EOL> if value is not None : <EOL> ctrl . setValue ( value ) <EOL> return ctrl <EOL> def getMainProgressBar ( ) : <EOL> import uitypes <EOL> return uitypes . ProgressBar ( melGlobals [ '<STR_LIT>' ] ) <EOL> if _versions . current ( ) >= _versions . v2011 : <EOL> from uitypes import toQtObject , toQtLayout , toQtControl , toQtMenuItem , toQtWindow </s>
