# HG changeset patch # User Brecht De Man # Date 1507897162 -7200 # Node ID c496aef6448bc8460f83b9194b73ff52c850d80e # Parent 142df41a1aeb78d78ca495a305441076a3fc2914 Quick fixes; generate_report.py: prepend zero for single digit minute/second values in time diff -r 142df41a1aeb -r c496aef6448b python/generate_report.py --- a/python/generate_report.py Wed Oct 04 08:58:38 2017 +0200 +++ b/python/generate_report.py Fri Oct 13 14:19:22 2017 +0200 @@ -152,9 +152,14 @@ second = time_node.get("secs") date_array.append((int(year),int(month),int(day),\ int(hour),int(minute),int(second))) + + # prepend zero if needed + minute_string = str(minute) if int(minute)>9 else "0"+str(minute) + second_string = str(second) if int(second)>9 else "0"+str(second) # date as section title - body = '\n\section{'+day+' '+month_array[int(month)-1]+' '+year+' '+hour+':'+minute+':'+second+'}\n' + body = '\n\section{'+day+' '+month_array[int(month)-1]+' '+year+' '+hour+':'+\ + minute_string+':'+second_string+'}\n' # file name body += '\t\tFile: '+file[:-4]+'\\\\ \n' @@ -447,7 +452,7 @@ plt.savefig(folder_name+"subjects_per_page.pdf", bbox_inches='tight') plt.close() -# SHOW both figures +# SHOW these figures body += r''' \begin{figure}[htbp] \begin{center} @@ -486,14 +491,15 @@ #TODO layout of figures # SHOW boxplot per page (in alphabetical order of page name) +#TODO get scale names (now hardcoded 'preference' automatically) body += '\t\t\\clearpage \n\t\\subsection*{Ratings per page}\n' for page_name in sorted(page_names): # get each name # plot boxplot if exists (not so for the 'alt' names) - if os.path.isfile(folder_name+'ratings/'+page_name+'-ratings-box.pdf'): + if os.path.isfile(folder_name+'ratings/'+page_name+'-preference-ratings-box.pdf'): body += r'''\begin{figure}[H] \begin{center} \includegraphics[width=.65\textwidth]{'''+\ - folder_name+"ratings/"+page_name+'-ratings-box.pdf'+\ + folder_name+"ratings/"+page_name+'-preference-ratings-box.pdf'+\ r'''} \caption{Box plot of ratings for page '''+\ page_name+' ('+str(subject_count[real_page_names.index(page_name)])+\ diff -r 142df41a1aeb -r c496aef6448b test_create.html --- a/test_create.html Wed Oct 04 08:58:38 2017 +0200 +++ b/test_create.html Fri Oct 13 14:19:22 2017 +0200 @@ -38,7 +38,7 @@