summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2010-06-20 20:51:24 +0200
committerThorsten Behrens <tbehrens@novell.com>2010-06-20 20:51:24 +0200
commit8320c492adc02c1438c7cbc315356acc180d2aa3 (patch)
treeaa571c097ddb1309284630ed95457b78e27489ba
parentb22c72c15c93227e76bdc7bff1c350abec06aa21 (diff)
Added bold/italic hello world examplemorewip
-rw-r--r--examples/ooxml-strict/hello-world.docxbin0 -> 8738 bytes
-rw-r--r--examples/ooxml-strict/helloworld.py25
-rwxr-xr-xexamples/ooxml-strict/test.sh1
3 files changed, 26 insertions, 0 deletions
diff --git a/examples/ooxml-strict/hello-world.docx b/examples/ooxml-strict/hello-world.docx
new file mode 100644
index 0000000..9a39f78
--- /dev/null
+++ b/examples/ooxml-strict/hello-world.docx
Binary files differ
diff --git a/examples/ooxml-strict/helloworld.py b/examples/ooxml-strict/helloworld.py
new file mode 100644
index 0000000..792922a
--- /dev/null
+++ b/examples/ooxml-strict/helloworld.py
@@ -0,0 +1,25 @@
+# Copyright 2010, Thorsten Behrens, Novell Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain a
+# copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import re
+from opc import ALL_OOXML as ALL_OOXML
+
+# use default list of xml mimetypes in opc
+mimetypes = ALL_OOXML
+
+# always iterate once over a matched element
+iterations = lambda i: 1
+
+# always use the same regexp regardless of mimetype
+worklist = lambda i: [re.compile('.*CT_OnOff'), re.compile('.*val.*')]
diff --git a/examples/ooxml-strict/test.sh b/examples/ooxml-strict/test.sh
index 0263bd9..1764a45 100755
--- a/examples/ooxml-strict/test.sh
+++ b/examples/ooxml-strict/test.sh
@@ -8,3 +8,4 @@ sh genbindings.sh
echo ; echo ; echo "Running demo iteration" ; echo ; echo
python dumpsample.py demo Lorem-ipsum.docx /tmp
python xls_sample.py demo_refmode test-refmode.xlsx /tmp
+python dumpsample.py helloworld hello-world.docx /tmp