#NEWLINE# def user_export_artist_tabular( request , username , artist , filetype ) : #NEWLINE# #INDENT# uh = UserHistory ( username ) #NEWLINE# uh . load_if_possible ( ) #NEWLINE# data = [ ( ( 'Week' , { #NEWLINE# #INDENT# 'bold' : True , #NEWLINE# #UNINDENT# } ) , ( 'Plays' , { #NEWLINE# #INDENT# 'bold' : True , #NEWLINE# #UNINDENT# } ) ) ] #NEWLINE# try : #NEWLINE# #INDENT# for ( week , plays ) in uh . artists [ artist ] . items ( ) : #NEWLINE# #INDENT# data . append ( ( week , plays ) ) #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise Http404 ( 'No such artist.' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return as_filetype ( data , filetype , filename = ( '%s_%s' % ( username , artist ) ) ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise Http404 ( 'No such filetype' )