From aaa1c07b84e8744dd4b13b5094899b66c1de5b85 Mon Sep 17 00:00:00 2001 From: Jim Fulton Date: Thu, 24 Feb 2005 14:22:35 +0000 Subject: [PATCH] Now also read descriptions. --- publication.xpdl | 4 +++- xpdl.py | 5 +++++ xpdl.txt | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/publication.xpdl b/publication.xpdl index 67ce380..93d09f2 100644 --- a/publication.xpdl +++ b/publication.xpdl @@ -95,7 +95,9 @@ - + + Prepare the initial draft + diff --git a/xpdl.py b/xpdl.py index dd07c2a..ae894f3 100644 --- a/xpdl.py +++ b/xpdl.py @@ -174,6 +174,11 @@ def application(self, app): self.stack[-1].defineApplications(**{str(app.id): app}) end_handlers[(xpdlns, 'Application')] = application + def description(self, ignored): + if self.stack[-1] is not None: + self.stack[-1].description = self.text + end_handlers[(xpdlns, 'Description')] = description + ###################################################################### # Activity definitions diff --git a/xpdl.txt b/xpdl.txt index 820a866..36f71e6 100644 --- a/xpdl.txt +++ b/xpdl.txt @@ -341,3 +341,15 @@ Now, let's try out our process. We'll follow the same steps we did in >>> context.decision True + +Descriptions +============ + +Most process elements can have names and descriptions. + + >>> pd.applications['prepare'].__name__ + u'Prepare' + + >>> pd.applications['prepare'].description + u'Prepare the initial draft' +