#NEWLINE# def generate( self ) : #NEWLINE# #INDENT# self . count = 0 #NEWLINE# if os . path . exists ( self . sitepath ) : #NEWLINE# #INDENT# for file_object in os . listdir ( self . sitepath ) : #NEWLINE# #INDENT# file_object_path = os . path . join ( self . sitepath , file_object ) #NEWLINE# if os . path . isfile ( file_object_path ) : #NEWLINE# #INDENT# os . unlink ( file_object_path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# shutil . rmtree ( file_object_path ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# QDir ( ) . mkpath ( self . htmlpath ) #NEWLINE# self . initTree ( self . notepath , '' ) #NEWLINE# cssSrcPath = os . path . join ( self . notebookPath , 'css' ) #NEWLINE# cssDstPath = os . path . join ( self . sitepath , 'css' ) #NEWLINE# attachSrcPath = os . path . join ( self . notebookPath , 'attachments' ) #NEWLINE# attachDstPath = os . path . join ( self . sitepath , 'attachments' ) #NEWLINE# shutil . copytree ( cssSrcPath , cssSrcPath ) #NEWLINE# if os . path . exists ( attachSrcPath ) : #NEWLINE# #INDENT# shutil . copytree ( attachSrcPath , attachDstPath ) #NEWLINE# #UNINDENT# print ( 'Finished: Processed' , self . count , 'notes.' )