Skip to content

Commit

Permalink
Add doc strings to module handlers (#3286)
Browse files Browse the repository at this point in the history
* Add doc strings to handlers

* Remove spaces, typo

Co-authored-by: hwatheod <ted@learningu.org>

* Fix survey management doc string

Co-authored-by: hwatheod <ted@learningu.org>
  • Loading branch information
willgearty and hwatheod authored May 17, 2021
1 parent 0877d23 commit 4bba497
Show file tree
Hide file tree
Showing 75 changed files with 125 additions and 31 deletions.
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/accountingmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
from esp.utils.web import render_to_response

class AccountingModule(ProgramModuleObj):
doc = """Lists accounting information for the program for a single user."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 1 addition & 1 deletion esp/esp/program/modules/handlers/adminclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
""" Module in the middle of a rewrite. -Michael """

class AdminClass(ProgramModuleObj):
doc = """ This module is extremely useful for managing classes if you have them them in your program.
doc = """This module is extremely useful for managing classes if you have them in your program.
Works best with student and teacher class modules, but they are not necessary.
Options for this are available on the main manage page.
"""
Expand Down
3 changes: 2 additions & 1 deletion esp/esp/program/modules/handlers/admincore.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class NewPermissionForm(forms.Form):
end_date = forms.DateTimeField(label='Closing date/time', initial=None, widget=DateTimeWidget(), required=False)

class AdminCore(ProgramModuleObj, CoreModule):
doc = """Includes the core views for managing a program (e.g. settings, dashboard)."""

@classmethod
def module_properties(cls):
Expand All @@ -76,7 +77,7 @@ def main(self, request, tl, one, two, module, extra, prog):
context = {}
modules = self.program.getModules(request.user, 'manage')

context['modules'] = modules
context['modules'] = sorted(modules, key = lambda pmo: pmo.module.link_title)
context['one'] = one
context['two'] = two

Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/adminreviewapps.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
__all__ = ['AdminReviewApps']

class AdminReviewApps(ProgramModuleObj):
doc = """View student applications and select students to be admitted for the program."""

@classmethod
def module_properties(cls):
return {
Expand Down
3 changes: 1 addition & 2 deletions esp/esp/program/modules/handlers/adminvitals.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class KeyDoesNotExist(Exception):
pass

class AdminVitals(ProgramModuleObj):
doc = """ This allows you to view the major numbers for your program on the main page.
This will present itself below the options in a neat little table. """
doc = """This allows you to view the major numbers for your program on the dashboard."""

@classmethod
def module_properties(cls):
Expand Down
7 changes: 2 additions & 5 deletions esp/esp/program/modules/handlers/admissionsdashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@
import json

class AdmissionsDashboard(ProgramModuleObj):
"""
A dashboard for Junction core teachers to review applications for their class.
Not to be confused with TeacherReviewApps, the app questions module.
"""
doc = """A dashboard for Junction core teachers to review applications for their class.
Not to be confused with TeacherReviewApps, the app questions module."""

@classmethod
def module_properties(cls):
Expand Down
2 changes: 1 addition & 1 deletion esp/esp/program/modules/handlers/ajaxschedulingmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import calendar, time, datetime

class AJAXSchedulingModule(ProgramModuleObj):
""" This program module allows teachers to indicate their availability for the program. """
doc = """Provides an application to use for scheduling classes."""

@classmethod
def module_properties(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


class AutoschedulerFrontendModule(ProgramModuleObj):
doc = """Augments the AJAX scheduler, adding an interface to automatically schedule individual sections."""

@classmethod
def module_properties(cls):
Expand Down Expand Up @@ -112,6 +113,9 @@ def autoscheduler_save(self, request, tl, one, two, module, extra, prog):
def autoscheduler_clear(self, request, tl, one, two, module, extra, prog):
return {'response': [{'success': 'yes'}]}

def isStep(self):
return False

class Meta:
proxy = True
app_label = 'modules'
3 changes: 1 addition & 2 deletions esp/esp/program/modules/handlers/availabilitymodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@


class AvailabilityModule(ProgramModuleObj):
""" This program module allows teachers to indicate their availability for the program. """
doc = """This program module allows teachers to indicate their availability for the program."""

@classmethod
def module_properties(cls):
Expand Down Expand Up @@ -244,4 +244,3 @@ def isStep(self):
class Meta:
proxy = True
app_label = 'modules'

1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/bigboardmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


class BigBoardModule(ProgramModuleObj):
doc = """Shows statistics about student registration that refresh automatically."""

@classmethod
def module_properties(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import random

class BulkCreateAccountModule(ProgramModuleObj):
doc = """Create a bulk set of accounts (e.g. for outreach)."""

MAX_PREFIX_LENGTH = 30
MAX_NUMBER_OF_ACCOUNTS = 1000 # backstop so that an errant request can't fill up the DB with accounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


class CheckAvailabilityModule(ProgramModuleObj):
""" This program module allows admins to check a teacher's availability for the program. """
doc = """Check a teacher's availability for the program."""

@classmethod
def module_properties(cls):
Expand Down
3 changes: 2 additions & 1 deletion esp/esp/program/modules/handlers/classsearchmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@


class ClassSearchModule(ProgramModuleObj):
"""Search for classes matching certain criteria."""
doc = """Search for classes matching certain criteria."""

@classmethod
def module_properties(cls):
return {
Expand Down
1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/commmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from esp.middleware import ESPError

class CommModule(ProgramModuleObj):
doc = """Email users that match specific search criteria."""
""" Want to email all ESP students within a 60 mile radius of NYC?
How about emailing all esp users within a 30 mile radius of New Hampshire whose last name contains 'e' and 'a'?
Do that and even more useful things in the communication panel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
from esp.middleware.threadlocalrequest import get_current_request

class CreditCardModule_Cybersource(ProgramModuleObj):
doc = """Accept credit card payments via Cybersource."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/creditcardmodule_stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import re

class CreditCardModule_Stripe(ProgramModuleObj):
doc = """Accept credit card payments via Stripe."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/creditcardviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
from argcache import cache_function

class CreditCardViewer(ProgramModuleObj):
doc = """Lists the credit card payments for the program."""

@classmethod
def module_properties(cls):
return {
Expand Down
1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/customformmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import re

class CustomFormModule(ProgramModuleObj):
doc = """Serve a custom form as part of student and/or teacher registration."""

def __init__(self, *args, **kwargs):
super(CustomFormModule, self).__init__(*args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/donationmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def clean_custom_amount(self):


class DonationModule(ProgramModuleObj):
doc = """Solicit donations from students."""

event = "donation_done"

Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/finaidapprovemodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@


class FinAidApproveModule(ProgramModuleObj):
doc = """View and approve student financial aid applications."""

@classmethod
def module_properties(cls):
return {
Expand Down
3 changes: 2 additions & 1 deletion esp/esp/program/modules/handlers/financialaidappmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
from django import forms


# student class picker module
class FinancialAidAppModule(ProgramModuleObj):
doc = """Serve a financial aid application to students."""

@classmethod
def module_properties(cls):
return {
Expand Down
3 changes: 1 addition & 2 deletions esp/esp/program/modules/handlers/formstackappmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@
from urllib import urlencode

class FormstackAppModule(ProgramModuleObj):
"""
doc = """
Student application module for Junction.
Not to be confused with StudentJunctionAppModule, the app questions module.
"""

Expand Down
2 changes: 1 addition & 1 deletion esp/esp/program/modules/handlers/formstackmedliabmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

# hackish solution for Splash 2012
class FormstackMedliabModule(ProgramModuleObj):
""" Module for collecting medical information online via Formstack """
doc = """Module for collecting medical information online via Formstack"""

@classmethod
def module_properties(cls):
Expand Down
1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/grouptextmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from twilio.rest import TwilioRestClient

class GroupTextModule(ProgramModuleObj):
doc = """Text users that match specific search criteria."""
""" Want to tell all enrolled students about a last-minute lunch location
change? Want to inform students about a cancelled class? The Group Text
Panel is your friend!
Expand Down
2 changes: 1 addition & 1 deletion esp/esp/program/modules/handlers/jsondatamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
from decimal import Decimal

class JSONDataModule(ProgramModuleObj, CoreModule):
""" A program module dedicated to returning program-specific data in JSON form. """
doc = """A program module dedicated to returning program-specific data in JSON form."""

@classmethod
def module_properties(cls):
Expand Down
1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/lineitemsmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from esp.utils.web import render_to_response

class LineItemsModule(ProgramModuleObj, CoreModule):
doc = """Create and/or edit line items for the program."""

@classmethod
def module_properties(cls):
Expand Down
1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/listgenmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ def __init__(self, *args, **kwargs):
self.fields['fields'].initial = ['02_username','04_firstname','05_lastname','06_email']

class ListGenModule(ProgramModuleObj):
doc = """Get information for users that match specific search criteria."""
""" While far from complete, this will allow you to just generate a simple list of users matching a criteria (criteria very similar to the communications panel)."""
@classmethod
def module_properties(cls):
Expand Down
1 change: 1 addition & 0 deletions esp/esp/program/modules/handlers/lotteryfrontendmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from esp.utils.decorators import json_response

class LotteryFrontendModule(ProgramModuleObj):
doc = """Run the class lottery and assign students to classes."""

@classmethod
def module_properties(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@


class LotteryStudentRegModule(ProgramModuleObj):
doc = """Allows students to enter a lottery for particular classes."""

def students(self, QObject = False):
q = Q(studentregistration__section__parent_class__parent_program=self.program) & nest_Q(StudentRegistration.is_valid_qobject(), 'studentregistration')
Expand Down
2 changes: 1 addition & 1 deletion esp/esp/program/modules/handlers/mailinglabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


class MailingLabels(ProgramModuleObj):
""" This allows one to generate Mailing Labels for both schools and users. You have the option of either creating a file which can be sent to MIT mailing services or actually create printable files.
doc = """This allows one to generate Mailing Labels for both schools and users. You have the option of either creating a file which can be sent to MIT mailing services or actually create printable files.
"""

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion esp/esp/program/modules/handlers/mapgenmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
from collections import Counter

class MapGenModule(ProgramModuleObj):
""" Allows you to generate a map showing the distribution of the selected users. """
doc = """Allows you to generate a map showing the distribution of the selected users."""

@classmethod
def module_properties(cls):
return {
Expand Down
3 changes: 2 additions & 1 deletion esp/esp/program/modules/handlers/nametagmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@


class NameTagModule(ProgramModuleObj):
""" This module allows you to generate a bunch of IDs for everyone in the program. """
doc = """This module allows you to generate a bunch of IDs for users that match specific criteria."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/onsiteattendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
import datetime

class OnSiteAttendance(ProgramModuleObj):
doc = """Provides statistics on program attendance and allows admins to take attendance for classes."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/onsitecheckinmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@


class OnSiteCheckinModule(ProgramModuleObj):
doc = """Check in students for a program (including for payments and forms)."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/onsitecheckoutmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
from esp.middleware.esperrormiddleware import ESPError

class OnSiteCheckoutModule(ProgramModuleObj):
doc = """Check students out (temporarily or indefinitely) from a program."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/onsiteclasslist.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
from esp.accounting.controllers import IndividualAccountingController

class OnSiteClassList(ProgramModuleObj):
doc = """Display lists of classes for onsite registration purposes."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/onsiteclassschedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
from datetime import datetime, timedelta

class OnsiteClassSchedule(ProgramModuleObj):
doc = """Get and/or print a student's schedule for the program."""

@classmethod
def module_properties(cls):
return {
Expand Down
4 changes: 3 additions & 1 deletion esp/esp/program/modules/handlers/onsitecore.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@


class OnsiteCore(ProgramModuleObj, CoreModule):
doc = """Serves the main onsite page."""

@classmethod
def module_properties(cls):
return {
Expand All @@ -55,7 +57,7 @@ def module_properties(cls):
@main_call
@needs_onsite
def main(self, request, tl, one, two, module, extra, prog):
""" Display a teacher eg page """
""" Display the onsite landing page """
context = {}
modules = self.program.getModules(request.user, 'onsite')

Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/onsitepaiditemsmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@


class OnsitePaidItemsModule(ProgramModuleObj):
doc = """Lists the items that a student has requested/paid for."""

@classmethod
def module_properties(cls):
return {
Expand Down
2 changes: 2 additions & 0 deletions esp/esp/program/modules/handlers/onsiteprintschedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
from django.template.loader import select_template

class OnsitePrintSchedules(ProgramModuleObj):
doc = """Automatically print student schedules at onsite registration."""

@classmethod
def module_properties(cls):
return {
Expand Down
Loading

0 comments on commit 4bba497

Please sign in to comment.