Ignore:
Timestamp:
24 Nov 2011, 11:31:04 (13 years ago)
Author:
Henrik Bettermann
Message:

Rename functions according to the WAeUP style guide:

functions and methods with property decorator with underscore

methods with CamelCase

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7184 r7186  
    737737            self.request)
    738738        students_utils = getUtility(IStudentsUtils)
    739         return students_utils.render_pdf(
     739        return students_utils.renderPDF(
    740740            self,'Course Registration', 'course_registration.pdf',
    741741            self.context.getStudent, studentview)
     
    10221022                return
    10231023        students_utils = getUtility(IStudentsUtils)
    1024         pay_details  = students_utils.get_payment_details(
     1024        pay_details  = students_utils.getPaymentDetails(
    10251025            p_category,student)
    10261026        if pay_details['error']:
     
    11771177            self.request)
    11781178        students_utils = getUtility(IStudentsUtils)
    1179         return students_utils.render_pdf(self,'Payment', 'payment_receipt.pdf',
     1179        return students_utils.renderPDF(self,'Payment', 'payment_receipt.pdf',
    11801180            self.context.getStudent, studentview)
    11811181
     
    12891289        student = self.context.getStudent()
    12901290        students_utils = getUtility(IStudentsUtils)
    1291         acc_details  = students_utils.get_accommodation_details(student)
     1291        acc_details  = students_utils.getAccommodationDetails(student)
    12921292        if not student.state in acc_details['allowed_states']:
    12931293            self.flash("You are in the wrong registration state.")
     
    13271327            if available_beds:
    13281328                students_utils = getUtility(IStudentsUtils)
    1329                 bed = students_utils.select_bed(available_beds)
     1329                bed = students_utils.selectBed(available_beds)
    13301330                bed.bookBed(student.student_id)
    13311331            else:
     
    14091409            self.request)
    14101410        students_utils = getUtility(IStudentsUtils)
    1411         return students_utils.render_pdf(
     1411        return students_utils.renderPDF(
    14121412            self,'Bed Allocation', 'bed_allocation.pdf',
    14131413            self.context.getStudent, studentview)
     
    14341434        student = self.context.getStudent()
    14351435        students_utils = getUtility(IStudentsUtils)
    1436         acc_details  = students_utils.get_accommodation_details(student)
     1436        acc_details  = students_utils.getAccommodationDetails(student)
    14371437        if self.context.bed != None and \
    14381438              'reserved' in self.context.bed.bed_type:
     
    14621462            if available_beds:
    14631463                students_utils = getUtility(IStudentsUtils)
    1464                 new_bed = students_utils.select_bed(available_beds)
     1464                new_bed = students_utils.selectBed(available_beds)
    14651465                new_bed.bookBed(student.student_id)
    14661466            else:
     
    17191719
    17201720    @grok.action('Save and request clearance')
    1721     def requestclearance(self, **data):
     1721    def requestClearance(self, **data):
    17221722        self.applyData(self.context, **data)
    17231723        self.context._p_changed = True
     
    19641964
    19651965    @grok.action('Register course list')
    1966     def register_courses(self, **data):
     1966    def RegisterCourses(self, **data):
    19671967        state = IWorkflowState(self.context.getStudent()).getState()
    19681968        IWorkflowInfo(self.context.getStudent()).fireTransition('register_courses')
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r7150 r7186  
    3030
    3131    """
    32     def get_payment_details(category, student):
     32    def getPaymentDetails(category, student):
    3333        """Get the payment dates of a student for the payment category
    3434        specified.
     
    3636        """
    3737
    38     def get_accommodation_details(student):
     38    def getAccommodation_details(student):
    3939        """Determine the accommodation dates of a student.
    4040
    4141        """
    4242
    43     def select_bed(available_beds):
     43    def selectBed(available_beds):
    4444        """Select a bed from a list of available beds.
    4545
     
    4848        """
    4949
    50     def render_pdf(view, subject='', filename='slip.pdf',):
     50    def renderPDF(view, subject='', filename='slip.pdf',):
    5151        """Render pdf slips for various pages.
    5252
  • main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py

    r7150 r7186  
    3535    return
    3636
    37 def setUpWidgets(view, ignore_request=False):
     37def set_up_widgets(view, ignore_request=False):
    3838    view.adapters = {}
    3939    view.widgets = setUpEditWidgets(
     
    4444
    4545def render_student_data(student, studentview):
    46     setUpWidgets(studentview, ignore_request=True)
     46    set_up_widgets(studentview, ignore_request=True)
    4747    data = []
    4848    style = getSampleStyleSheet()
     
    6363    grok.implements(IStudentsUtils)
    6464
    65     def get_payment_details(self,category, student):
     65    def getPaymentDetails(self,category, student):
    6666        d = {}
    6767        d['p_item'] = u''
     
    8585            d['amount'] = academic_session.clearance_fee
    8686        elif category == 'bed_allocation':
    87             d['p_item'] = self.get_accommodation_details(student)['bt']
     87            d['p_item'] = self.getAccommodationDetails(student)['bt']
    8888            d['amount'] = academic_session.booking_fee
    8989        return d
    9090
    91     def get_accommodation_details(self, student):
     91    def getAccommodationDetails(self, student):
    9292        d = {}
    9393        d['error'] = u''
     
    117117    # In the standard configuration we select the first bed found,
    118118    # but can also randomize the selection if we like.
    119     def select_bed(self, available_beds):
     119    def selectBed(self, available_beds):
    120120        return available_beds[0]
    121121
    122     def render_pdf(self, view, subject='', filename='slip.pdf',
     122    def renderPDF(self, view, subject='', filename='slip.pdf',
    123123        student=None, studentview=None):
    124124        # (0,0),(-1,-1) = whole table
     
    153153            story.append(studenttable)
    154154        story.append(Spacer(1, 18))
    155         setUpWidgets(view)
     155        set_up_widgets(view)
    156156        data = []
    157157        for widget in view.widgets:
Note: See TracChangeset for help on using the changeset viewer.