#NEWLINE# @ classmethod #NEWLINE# def fromVisualization( cls , target , others ) : #NEWLINE# #INDENT# '\n        Create a L{Description} from a L{Thing} and some L{Paths} visually\n        related to that L{Thing}.\n\n        @param target: The L{IThing} being described by this L{Description}.\n        @type target: L{IThing}\n\n        @param others: Paths to items that are visible as portions of the\n            target.\n        @type others: L{list} of L{Path <imaginary.idea.Path>}s.\n\n        @return: A L{Description} comprising C{target} and C{others}.\n        ' #NEWLINE# exits = [ ] #NEWLINE# for other in others : #NEWLINE# #INDENT# anExit = other . targetAs ( IExit ) #NEWLINE# if ( anExit is not None ) : #NEWLINE# #INDENT# exits . append ( anExit ) #NEWLINE# #UNINDENT# #UNINDENT# exits . sort ( key = ( lambda anExit : anExit . name ) ) #NEWLINE# descriptionConcepts = [ ] #NEWLINE# for pup in target . powerupsFor ( iimaginary . IDescriptionContributor ) : #NEWLINE# #INDENT# descriptionConcepts . append ( pup . contributeDescriptionFrom ( others ) ) #NEWLINE# #UNINDENT# def index( c ) : #NEWLINE# #INDENT# preferredOrder = [ 'ExpressCondition' , 'ExpressClothing' ] #NEWLINE# try : #NEWLINE# #INDENT# return preferredOrder . index ( c . __class__ . __name__ ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# return len ( preferredOrder ) #NEWLINE# #UNINDENT# #UNINDENT# descriptionConcepts . sort ( key = index ) #NEWLINE# return cls ( title = Noun ( target ) . shortName ( ) , exits = exits , description = target . description , components = descriptionConcepts , target = target )