summaryrefslogtreecommitdiff
path: root/src/examples/mozillaCalendarParser.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2015-12-31 00:55:47 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2015-12-31 00:55:47 +0000
commit401ba4a945b88f12e26495a82d4059d4adbaec92 (patch)
tree9570287813d7358750ddd1ffe50ba60c0a999972 /src/examples/mozillaCalendarParser.py
parentc8e8c6592d625d24bc7c0ca34bcc527ec380c2d5 (diff)
downloadpyparsing-git-401ba4a945b88f12e26495a82d4059d4adbaec92.tar.gz
Added new example parseTabularData.py
Updated several examples to more current Python and pyparsing practices (and better Py2/Py3 cross-compatibility)
Diffstat (limited to 'src/examples/mozillaCalendarParser.py')
-rw-r--r--src/examples/mozillaCalendarParser.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/examples/mozillaCalendarParser.py b/src/examples/mozillaCalendarParser.py
index 2805c95..210f284 100644
--- a/src/examples/mozillaCalendarParser.py
+++ b/src/examples/mozillaCalendarParser.py
@@ -16,8 +16,7 @@ License: Free for any use
BEGIN = Literal("BEGIN:").suppress()
END = Literal("END:").suppress()
-str = printables + "\xe4\xf6\xe5\xd6\xc4\xc5"
-valstr = str + " "
+valstr = printables + "\xe4\xf6\xe5\xd6\xc4\xc5 "
EQ = Literal("=").suppress()
SEMI = Literal(";").suppress()
@@ -70,7 +69,7 @@ calendars = OneOrMore(calendar)
def gotEvent(s,loc,toks):
for event in toks:
- print (event['summary'], "from", event["begin"], "to", event["end"])
+ print(event.dump())
event.setParseAction(gotEvent)