Ignore:
Timestamp:
2 Feb 2017, 07:58:49 (8 years ago)
Author:
Henrik Bettermann
Message:

Adjust report components.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py

    r14135 r14495  
    2929from reportlab.lib import colors
    3030from reportlab.lib.units import cm, inch, mm
    31 from reportlab.lib.pagesizes import A4, landscape, portrait
     31from reportlab.lib.pagesizes import A4, A3, landscape, portrait
    3232from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
    3333from reportlab.pdfgen.canvas import Canvas
     
    858858    pagesize = landscape(A4)
    859859
     860class A3LandscapePDFCreator(LandscapePDFCreator):
     861    """A utility to help with generating PDF docs in
     862    A3 landscape format. No watermark is shown.
     863    """
     864    grok.name('A3landscape')
     865    pagesize = landscape(A3)
     866
    860867def get_qrcode(text, width=60.0):
    861868    """Get a QR Code as Reportlab Flowable (actually a `Drawing`).
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py

    r14493 r14495  
    8484        for ticket in level_obj.values():
    8585            if ticket.code in course_codes:
    86                 if not None in (ticket.score, ticket.ca):
    87                     scores[ticket.code] = (
    88                         ticket.score + ticket.ca, ticket.grade)
     86                if ticket.total_score is not None:
     87                    scores[ticket.code] = (ticket.total_score, ticket.grade)
    8988                else:
    9089                    scores[ticket.code] = ('NIL', '')
     
    120119        canvas.rotate(25)
    121120        canvas.drawString( 0, -1, self.text)
    122 
    123     #def wrap(self,aW,aH):
    124     #    canv = self.canv
    125     #    return canv._leading, canv.stringWidth(self.text)
    126121
    127122def tbl_data_to_table(data, course_codes):
     
    176171
    177172    note = ""
    178 
    179 #    note = """
    180 #<br /><br /><br /><br />
    181 #<font size='10'>
    182 #<strong>Note:</strong> This copy is subject to correction for typographical errors and ratification by the departmental board.
    183 #</font>
    184 #"""
    185 
    186     signatures = [
    187         translate(_('Head of Department')),
    188         translate(_('Dean of Faculty'))]
     173    signatures = None
    189174
    190175    def __init__(self, faccode, depcode, certcode, session, level,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_raw_score_report.py

    r14494 r14495  
    77from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    88from waeup.kofa.tests.test_async import FunctionalAsyncTestCase
     9from waeup.kofa.testing import FunctionalLayer
    910from waeup.kofa.browser.tests.test_pdf import samples_dir
    10 
    11 from waeup.aaue.students.reports.raw_score_report import (
     11from waeup.kofa.students.reports.raw_score_report import (
    1212    get_students, RawScoreReport, IRawScoreReport,
    1313    get_courses)
    14 from waeup.aaue.testing import FunctionalLayer
     14
    1515
    1616class RawScoreReportTests(CatalogTestSetup):
     
    2222        self.course = createObject('waeup.Course')
    2323        self.course.code = 'Course1'
     24        self.course.credits = 25
    2425        self.app['faculties']['fac1']['dep1'].courses.addCourse(
    2526            self.course)
     
    4243    def test_get_students(self):
    4344        # we can get a table with one student
    44         self.student['studycourse']['100']['Course1'].ca = 0
    4545        course_codes = get_courses('fac1', 'dep1', 'CERT1', 2010, 100)
    4646        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes)
    4747        self.assertEqual(result,
    48             [(u'1234', u'TESTER, Bob', {'Course1': (70, 'A')})])
    49         self.student['studycourse']['100']['Course1'].ca = None
     48            [(u'1234', u'Bob Tester', {'Course1': (70, 'A')})])
     49        self.student['studycourse']['100']['Course1'].score = None
    5050        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes)
    5151        self.assertEqual(result,
    52             [(u'1234', u'TESTER, Bob', {'Course1': ('NIL', '')})])
     52            [(u'1234', u'Bob Tester', {'Course1': ('NIL', '')})])
    5353        return
    5454
     
    5656        self.course = createObject('waeup.Course')
    5757        self.course.code = 'Course2'
     58        self.course.credits = 30
    5859        self.app['faculties']['fac1']['dep1'].courses.addCourse(
    5960            self.course)
Note: See TracChangeset for help on using the changeset viewer.