#NEWLINE# def prepare_file( self ) : #NEWLINE# #INDENT# zf = zipfile . ZipFile ( self . data_liberation_path ( ) , 'w' ) #NEWLINE# username = self . get_author_username ( ) #NEWLINE# user_data = Query . sql ( 'SELECT * FROM `users`\n                             WHERE `username` = %s' , username ) #NEWLINE# content_data = Query . sql ( 'SELECT * FROM `content`\n                                WHERE `username` = %s' , username ) #NEWLINE# zf . writestr ( 'user_data' , repr ( user_data ) ) #NEWLINE# zf . writestr ( 'content_data' , repr ( content_data ) ) #NEWLINE# files = os . walk ( url_factory . resource_directory ( self ) ) #NEWLINE# for f in files : #NEWLINE# #INDENT# for filename in f [ 2 ] : #NEWLINE# #INDENT# path = os . path . join ( f [ 0 ] , filename ) #NEWLINE# arcname = path [ ( len ( url_factory . resource_directory ( self ) ) - len ( username ) ) : ] #NEWLINE# zf . write ( path , arcname ) #NEWLINE# #UNINDENT# #UNINDENT# zf . close ( )