<s> from __future__ import with_statement <EOL> import IECore <EOL> import Gaffer <EOL> import GafferUI <EOL> import GafferCortex <EOL> import GafferCortexUI <EOL> __nodeTypes = ( <EOL> GafferCortex . ParameterisedHolderNode , <EOL> GafferCortex . ParameterisedHolderComputeNode , <EOL> GafferCortex . ParameterisedHolderDependencyNode , <EOL> GafferCortex . ParameterisedHolderExecutableNode , <EOL> ) <EOL> class StringParameterValueWidget ( GafferCortexUI . ParameterValueWidget ) : <EOL> def __init__ ( self , parameterHandler , parenting = None ) : <EOL> multiLine = False <EOL> with IECore . IgnoredExceptions ( KeyError ) : <EOL> multiLine = parameterHandler . parameter ( ) . userData ( ) [ "<STR_LIT>" ] [ "<STR_LIT>" ] . value <EOL> if multiLine : <EOL> plugValueWidget = GafferUI . MultiLineStringPlugValueWidget ( parameterHandler . plug ( ) ) <EOL> else : <EOL> plugValueWidget = GafferUI . StringPlugValueWidget ( parameterHandler . plug ( ) ) <EOL> with IECore . IgnoredExceptions ( KeyError ) : <EOL> if parameterHandler . parameter ( ) . userData ( ) [ "<STR_LIT>" ] [ "<STR_LIT:password>" ] . value : <EOL> plugValueWidget . textWidget ( ) . setDisplayMode ( GafferUI . TextWidget . DisplayMode . Password ) <EOL> GafferCortexUI . ParameterValueWidget . __init__ ( self , plugValueWidget , parameterHandler , parenting = parenting ) <EOL> GafferCortexUI . ParameterValueWidget . registerType ( IECore . StringParameter , StringParameterValueWidget ) <EOL> def __fixedLineHeight ( plug ) : <EOL> parameter = plug . node ( ) . parameterHandler ( ) . parameter ( ) <EOL> for name in plug . relativeName ( plug . node ( ) ) . split ( "<STR_LIT:.>" ) [ <NUM_LIT:1> : ] : <EOL> if not isinstance ( parameter , IECore . CompoundParameter ) : <EOL> return None <EOL> else : <EOL> parameter = parameter [ name ] <EOL> fixedLineHeight = None <EOL> with IECore . IgnoredExceptions ( KeyError ) : <EOL> fixedLineHeight = parameter . userData ( ) [ "<STR_LIT>" ] [ "<STR_LIT>" ] . value <EOL> return fixedLineHeight <EOL> for nodeType in __nodeTypes : <EOL> Gaffer . Metadata . registerPlugValue ( nodeType , "<STR_LIT:*>" , "<STR_LIT>" , __fixedLineHeight ) </s>
