1.1 --- a/vCalendar.py Sun Nov 02 23:06:25 2008 +0100
1.2 +++ b/vCalendar.py Mon Nov 03 00:48:06 2008 +0100
1.3 @@ -161,12 +161,13 @@
1.4
1.5 # Public functions.
1.6
1.7 -def parse(f, non_standard_newline=0):
1.8 +def parse(stream_or_string, non_standard_newline=0):
1.9
1.10 """
1.11 - Parse the resource data found through the use of the file object 'f', which
1.12 - should provide Unicode data. (The codecs module can be used to open files or
1.13 - to wrap streams in order to provide Unicode data.)
1.14 + Parse the resource data found through the use of the 'stream_or_string',
1.15 + which is either a stream providing Unicode data (the codecs module can be
1.16 + used to open files or to wrap streams in order to provide Unicode data) or a
1.17 + filename identifying a file to be parsed.
1.18
1.19 The optional 'non_standard_newline' can be set to a true value (unlike the
1.20 default) in order to attempt to process files with CR as the end of line
1.21 @@ -176,14 +177,15 @@
1.22 is returned.
1.23 """
1.24
1.25 - return vContent.parse(f, non_standard_newline, vCalendarParser)
1.26 + return vContent.parse(stream_or_string, non_standard_newline, vCalendarParser)
1.27
1.28 -def iterparse(f, non_standard_newline=0):
1.29 +def iterparse(stream_or_string, non_standard_newline=0):
1.30
1.31 """
1.32 - Parse the resource data found through the use of the file object 'f', which
1.33 - should provide Unicode data. (The codecs module can be used to open files or
1.34 - to wrap streams in order to provide Unicode data.)
1.35 + Parse the resource data found through the use of the 'stream_or_string',
1.36 + which is either a stream providing Unicode data (the codecs module can be
1.37 + used to open files or to wrap streams in order to provide Unicode data) or a
1.38 + filename identifying a file to be parsed.
1.39
1.40 The optional 'non_standard_newline' can be set to a true value (unlike the
1.41 default) in order to attempt to process files with CR as the end of line
1.42 @@ -193,9 +195,9 @@
1.43 events of the form (name, parameters, value).
1.44 """
1.45
1.46 - return vContent.iterparse(f, non_standard_newline, vCalendarStreamParser)
1.47 + return vContent.iterparse(stream_or_string, non_standard_newline, vCalendarStreamParser)
1.48
1.49 -def iterwrite(f, line_length=None):
1.50 - return vContent.iterwrite(f, line_length, vCalendarStreamWriter)
1.51 +def iterwrite(stream_or_string, line_length=None):
1.52 + return vContent.iterwrite(stream_or_string, line_length, vCalendarStreamWriter)
1.53
1.54 # vim: tabstop=4 expandtab shiftwidth=4