imip-agent

Change of vCalendar.py

4:bcc012bf5481
vCalendar.py
     1.1 --- a/vCalendar.py	Mon Sep 22 17:08:22 2014 +0200
     1.2 +++ b/vCalendar.py	Mon Sep 22 17:08:57 2014 +0200
     1.3 @@ -41,6 +41,9 @@
     1.4  
     1.5  # Format details.
     1.6  
     1.7 +SECTION_TYPES = set([
     1.8 +    "VALARM", "VCALENDAR", "VEVENT", "VFREEBUSY", "VJOURNAL", "VTIMEZONE", "VTODO"
     1.9 +    ])
    1.10  QUOTED_PARAMETERS = set([
    1.11      "ALTREP", "DELEGATED-FROM", "DELEGATED-TO", "DIR", "MEMBER", "SENT-BY"
    1.12      ])
    1.13 @@ -146,6 +149,21 @@
    1.14  
    1.15      # Overridden methods.
    1.16  
    1.17 +    def write(self, name, parameters, value):
    1.18 +
    1.19 +        """
    1.20 +        Write a content line, serialising the given 'name', 'parameters' and
    1.21 +        'value' information.
    1.22 +        """
    1.23 +
    1.24 +        if name in SECTION_TYPES:
    1.25 +            self.write_content_line("BEGIN", {}, name)
    1.26 +            for n, p, v in value:
    1.27 +                self.write(n, p, v)
    1.28 +            self.write_content_line("END", {}, name)
    1.29 +        else:
    1.30 +            vContent.StreamWriter.write(self, name, parameters, value)
    1.31 +
    1.32      def encode_parameters(self, parameters):
    1.33  
    1.34          """