Frederic De Groef avatar Frederic De Groef committed 2dee7a5

updated the type-to-description look-up table, added some docstrings

Comments (0)

Files changed (1)

src/gehol/basecalendar.py

 
 TYPE_TO_DESCR = {
     'THE':u'Theorie',
-    'EXE':u'Exercices'
+    'EXE':u'Exercices',
+    'EXC':u'Excursion',
+    'GDC':u'Guidance',
+    'STG':u'Stage',
+    'TPR':u'Laboratoire',
+    'AGD':u'Agenda',
+    'GLB':u'Theorie ou Exercices',
+    'PRS':u'Travaux personnels',
+    'ACD':u'Activite academique'
 }
 
 def convert_type_to_description(type_mnemo):
+    """
+    Convert an activity type acronym into a human readable description.
+    """
     if type_mnemo in TYPE_TO_DESCR:
         return TYPE_TO_DESCR[type_mnemo]
     else:
         be serialized in an iCal file.
 
         We only keep here the data relating to the time at which
-        the event will occur.
+        the event will occur, as well as the organizer and location.
 
-        The summary, organizer, location and description are
-        dependent on the type of calendar you're handling, it is thus
-        your responsability to subclass BaseEvent and override the properties.
+        The summary and description are dependent on the type of calendar
+        you're handling, it is thus your responsability to subclass BaseEvent
+        and override the associated object properties.
 
         """
         self.weeks = kwargs['weeks']
 
     @property
     def summary(self):
-        return NotImplementedError
+        raise NotImplementedError
 
 
     @property
     def description(self):
-        return NotImplementedError
+        raise NotImplementedError
 
 
     def __repr__(self):
 
 
 class BaseCalendar(object):
+    """
+    Class defines the interface for a calendar that will be
+    serialized by the rfc5545icalwriter module.
+
+
+    The name and description properties need to be overridden
+    in a subclass, as their content is different depending on the
+    type of calendar you're handling.
+
+    This class also contains a list of events, which should be subclasses
+    of BaseEvent.
+    """
     def __init__(self):
         self.events = []
         
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.