#NEWLINE# def main( nick = None , user = None , dest = None ) : #NEWLINE# #INDENT# if ( nick is None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# nick = sys . argv [ 1 ] #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# print ( __doc__ ) #NEWLINE# sys . exit ( ( - 1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# dest = ( dest or os . getcwd ( ) ) #NEWLINE# user = ( user or os . environ . get ( 'USER' , 'mynick' ) ) #NEWLINE# config = dict ( nick = nick , user = user , hash = '${hash}' ) #NEWLINE# data = get_template ( 'config.ini' , ** config ) #NEWLINE# with open ( os . path . join ( dest , 'config.ini' ) , 'w' ) as fd : #NEWLINE# #INDENT# fd . write ( data ) #NEWLINE# #UNINDENT# data = get_template ( 'plugin.py' , ** config ) #NEWLINE# filename = os . path . join ( dest , '{nick}_plugin.py' . format ( ** config ) ) #NEWLINE# with open ( filename , 'w' ) as fd : #NEWLINE# #INDENT# fd . write ( fd )