#NEWLINE# def mkhier( self , descr ) : #NEWLINE# #INDENT# root = tempfile . mkdtemp ( ) #NEWLINE# sys . path . insert ( 0 , root ) #NEWLINE# if ( not os . path . isdir ( root ) ) : #NEWLINE# #INDENT# os . mkdir ( root ) #NEWLINE# #UNINDENT# for ( name , contents ) in descr : #NEWLINE# #INDENT# comps = name . split ( ) #NEWLINE# fullname = root #NEWLINE# for c in comps : #NEWLINE# #INDENT# fullname = os . path . join ( fullname , c ) #NEWLINE# #UNINDENT# if ( contents is None ) : #NEWLINE# #INDENT# os . mkdir ( fullname ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# f = open ( fullname , 'w' ) #NEWLINE# f . write ( contents ) #NEWLINE# if ( contents and ( contents [ ( - 1 ) ] != '\n' ) ) : #NEWLINE# #INDENT# f . write ( '\n' ) #NEWLINE# #UNINDENT# f . close ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . root = root #NEWLINE# self . pkgname = descr [ 0 ] [ 0 ]