Changeset 14373 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 6 Jan 2017, 22:40:30 (8 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/reports.py
r12901 r14373 44 44 """not when any output was created.""") 45 45 46 def create_pdf( ):46 def create_pdf(job_id): 47 47 """Generate a PDF copy. 48 48 """ … … 190 190 self.creation_dt = now() 191 191 192 def create_pdf(self ):192 def create_pdf(self, job_id): 193 193 raise NotImplementedError() 194 194 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r14372 r14373 185 185 self.data = get_students(faccode, depcode, session, level) 186 186 187 def create_pdf(self ):187 def create_pdf(self, job_id): 188 188 creator = getUtility(IPDFCreator, name='landscape') 189 189 table_data = tbl_data_to_table(self.data) … … 191 191 col_widths = [1*cm, 4*cm, 5*cm, 0.8*cm, 0.8*cm, 0.8*cm, 1*cm, 192 192 6*cm, 0.8*cm, 0.8*cm, 1*cm, 2*cm] 193 pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string, 193 pdf_data = [Paragraph('<b>%s - Report %s</b>' 194 % (self.creation_dt_string, job_id), 194 195 STYLE["Normal"]), 195 196 Spacer(1, 12),] -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py
r14269 r14373 143 143 self.data = get_students(faccode, depcode, session, level) 144 144 145 def create_pdf(self ):145 def create_pdf(self, job_id): 146 146 creator = getUtility(IPDFCreator) 147 147 #col_widths = [2*cm, 4*cm, 5*cm, 0.8*cm, 0.8*cm, 0.8*cm, 6*cm, ] 148 pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string, 148 pdf_data = [Paragraph('<b>%s - Report %s</b>' 149 % (self.creation_dt_string, job_id), 149 150 STYLE["Normal"]), 150 151 Spacer(1, 12),] -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_payment_statistics.py
r12897 r14373 200 200 self.data = get_student_payment_stats(session, mode, level, breakdown) 201 201 202 def create_pdf(self ):202 def create_pdf(self, job_id): 203 203 creator = getUtility(IPDFCreator, name='landscape') 204 204 table_data = tbl_data_to_table(*self.data) 205 205 col_widths = [None,] + [3.2*cm] * len(self.data[1]) + [None,] 206 pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string, 206 pdf_data = [Paragraph('<b>%s - Report %s</b>' 207 % (self.creation_dt_string, job_id), 207 208 STYLE["Normal"]), 208 209 Spacer(1, 12),] -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_statistics.py
r13236 r14373 161 161 self.data = get_student_stats(session, mode, level, breakdown) 162 162 163 def create_pdf(self ):163 def create_pdf(self, job_id): 164 164 creator = getUtility(IPDFCreator, name='landscape') 165 165 table_data = tbl_data_to_table(*self.data) 166 166 col_widths = [None,] + [1.6*cm] * len(self.data[1]) + [None,] 167 pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string, 167 pdf_data = [Paragraph('<b>%s - Report %s</b>' 168 % (self.creation_dt_string, job_id), 168 169 STYLE["Normal"]), 169 170 Spacer(1, 12),] … … 296 297 self.response.setHeader( 297 298 'Content-Disposition:', 'attachment; filename="%s' % filename) 298 pdf_stream = self.context.create_pdf( )299 pdf_stream = self.context.create_pdf(self.context.__name__) 299 300 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 300 301 grok.getSite().logger.info('%s - report %s downloaded: %s' % ( -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r14372 r14373 63 63 self.student['studycourse']['100']['Course3'] = ticket 64 64 report = LevelReport('fac1', 'dep1', 2010, 100) 65 result = report.create_pdf( )65 result = report.create_pdf('JOB_ID') 66 66 self.assertTrue(result.startswith('%PDF-')) 67 67 path = os.path.join(samples_dir(), 'level_report.pdf') -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py
r12898 r14373 63 63 def test_create_pdf(self): 64 64 report = SessionResultsPresentation('fac1', 'dep1', 2010, 100) 65 result = report.create_pdf( )65 result = report.create_pdf('JOB_ID') 66 66 self.assertTrue(result.startswith('%PDF-')) 67 67 path = os.path.join(samples_dir(), 'session_results_presentation.pdf') … … 81 81 self.student['studycourse']['620']['Course2'] = ticket 82 82 report = SessionResultsPresentation('fac1', 'dep1', 2013, 620) 83 result = report.create_pdf( )83 result = report.create_pdf('JOB_ID') 84 84 self.assertTrue(result.startswith('%PDF-')) 85 85 path = os.path.join(samples_dir(), 'session_results_presentation_620.pdf') … … 102 102 self.student['studycourse']['200']['Course2'] = ticket 103 103 report = SessionResultsPresentation('fac1', 'dep1', 2010, 0) 104 result = report.create_pdf( )104 result = report.create_pdf('JOB_ID') 105 105 self.assertTrue(result.startswith('%PDF-')) 106 106 path = os.path.join(samples_dir(), 'session_results_presentation_erroneous.pdf') -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_payment_statistics.py
r12897 r14373 56 56 report = StudentPaymentStatisticsReport( 57 57 2010, 'Undergraduate Full-Time', 0, 'faccode') 58 result = report.create_pdf( )58 result = report.create_pdf('JOB_ID') 59 59 self.assertTrue(result.startswith('%PDF-')) 60 60 path = os.path.join(samples_dir(), 'student_payment_statistics.pdf') -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py
r14169 r14373 120 120 report = StudentStatisticsReport( 121 121 2010, 'Undergraduate Full-Time', 0, 'faccode') 122 result = report.create_pdf( )122 result = report.create_pdf('JOB_ID') 123 123 self.assertTrue(result.startswith('%PDF-')) 124 124 path = os.path.join(samples_dir(), 'student_statistics.pdf') … … 131 131 report = StudentStatisticsReport( 132 132 2010, 'Undergraduate Full-Time', 100, 'faccode') 133 result = report.create_pdf( )133 result = report.create_pdf('JOB_ID') 134 134 self.assertTrue(result.startswith('%PDF-')) 135 135 path = os.path.join(samples_dir(), 'student_statistics_100.pdf') -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_reports.py
r12110 r14373 72 72 # trying to create a pdf results in an error 73 73 report = Report() 74 self.assertRaises(NotImplementedError, report.create_pdf )74 self.assertRaises(NotImplementedError, report.create_pdf, 'JOB_ID') 75 75 return 76 76
Note: See TracChangeset for help on using the changeset viewer.