#NEWLINE# def set_default_templates( defaults ) : #NEWLINE# #INDENT# for ( filename , content ) in defaults . items ( ) : #NEWLINE# #INDENT# path = conf . supybot . directories . data . web . dirize ( filename ) #NEWLINE# if os . path . isfile ( ( path + '.example' ) ) : #NEWLINE# #INDENT# os . unlink ( ( path + '.example' ) ) #NEWLINE# #UNINDENT# if ( not os . path . isdir ( os . path . dirname ( path ) ) ) : #NEWLINE# #INDENT# os . makedirs ( os . path . dirname ( path ) ) #NEWLINE# #UNINDENT# with open ( ( path + '.example' ) , 'a' ) as fd : #NEWLINE# #INDENT# fd . write ( content )