Permalink
Browse files

* split out object.picture from Elements so that increased coverage i…

…n test_pictures passes

* write test of Document.Copy
* add test of Document.NewSection
* add .bzrignore file to ignore pending directory
* add script to test coverage of code base
* write test script which runs nosetest on all unit tests and doctests
* centralize basic initializeDoc in tests
* move comments about test strategy
* delete old temp test code
* comment out unused code
* remove executable bit from tests so that nosetest can detect them
  • Loading branch information...
0 parents commit 307518cfb88ca7085c220a4c32e5bbfe1bc9cc4e Christian R. Simms csimms@csimms-desktop committed Nov 2, 2009
Showing with 5,128 additions and 0 deletions.
  1. +2 −0 .bzrignore
  2. +146 −0 ChangeLog
  3. +1 −0 DEPENDENCIES
  4. +21 −0 LICENSE
  5. +8 −0 README
  6. +115 −0 TODO
  7. +1 −0 VERSION
  8. +6 −0 admin/clean.sh
  9. +107 −0 admin/commit.sh
  10. +1 −0 admin/coverTest.sh
  11. +5 −0 admin/createLocalMirror.sh
  12. +74 −0 admin/generateReferenceDocs.py
  13. +15 −0 admin/repoVars.sh
  14. +3 −0 admin/sfUpload.sh
  15. +2 −0 admin/stat.sh
  16. +4 −0 admin/syncLocalRepo.sh
  17. +14 −0 admin/syncRepos.sh
  18. +67 −0 admin/syncSFRepo.py
  19. +1 −0 admin/testAll.sh
  20. +7 −0 admin/update.sh
  21. BIN docs/specs/1.0.rtf.gz
  22. BIN docs/specs/1.2.rtf.gz
  23. BIN docs/specs/1.3.rtf.gz
  24. BIN docs/specs/1.5.rtf.gz
  25. BIN docs/specs/1.7.rtf.gz
  26. BIN docs/specs/1.9.rtf.gz
  27. +4 −0 examples/IMPORTANT_NOTICE
  28. +368 −0 examples/examples.py
  29. +56 −0 examples/examples2.py
  30. BIN examples/image.jpg
  31. BIN examples/img1.png
  32. BIN examples/img2.png
  33. BIN examples/img3.png
  34. BIN examples/img4.png
  35. +78 −0 examples/merged_cells.py
  36. +155 −0 rtfng/Constants.py
  37. +140 −0 rtfng/Elements.py
  38. +526 −0 rtfng/PropertySets.py
  39. +645 −0 rtfng/Renderer.py
  40. +78 −0 rtfng/Styles.py
  41. 0 rtfng/__init__.py
  42. 0 rtfng/document/__init__.py
  43. +11 −0 rtfng/document/base.py
  44. +81 −0 rtfng/document/character.py
  45. +166 −0 rtfng/document/paragraph.py
  46. +56 −0 rtfng/document/section.py
  47. +9 −0 rtfng/ertf.py
  48. 0 rtfng/object/__init__.py
  49. +140 −0 rtfng/object/picture.py
  50. 0 rtfng/parser/__init__.py
  51. +85 −0 rtfng/parser/base.py
  52. +196 −0 rtfng/parser/grammar.py
  53. +103 −0 rtfng/utils.py
  54. 0 rtfng/writer/__init__.py
  55. +43 −0 setup.py
  56. 0 test/__init__.py
  57. 0 test/document/__init__.py
  58. +77 −0 test/document/test_characters.py
  59. +115 −0 test/document/test_headerfooter.py
  60. +172 −0 test/document/test_paragraphs.py
  61. +76 −0 test/document/test_sections.py
  62. +170 −0 test/document/test_tables.py
  63. 0 test/header/__init__.py
  64. 0 test/objects/__init__.py
  65. +49 −0 test/objects/test_pictures.py
  66. BIN test/resources/image.jpg
  67. BIN test/resources/img1.png
  68. BIN test/resources/img2.png
  69. BIN test/resources/img3.png
  70. BIN test/resources/img4.png
  71. +14 −0 test/sources/macrtf/simpleContent.rtf
  72. +18 −0 test/sources/macrtf/simpleContentFonts.rtf
  73. +14 −0 test/sources/macrtf/simpleContentLongLine.rtf
  74. +16 −0 test/sources/macrtf/simpleContentMultipleLines.rtf
  75. +20 −0 test/sources/macrtf/simpleContentMultipleLongFontLines.rtf
  76. +16 −0 test/sources/macrtf/simpleContentMultipleLongLines.rtf
  77. +20 −0 test/sources/macrtf/simpleContentParagraphs.rtf
  78. +14 −0 test/sources/macrtf/simpleContentUTF8.rtf
  79. +16 −0 test/sources/rtfng/charColours.rtf
  80. +15 −0 test/sources/rtfng/charStyleOverride.rtf
  81. +17 −0 test/sources/rtfng/charUnicode.rtf
  82. +17 −0 test/sources/rtfng/docCopy.rtf
  83. +19 −0 test/sources/rtfng/headerFooterDiffPages.rtf
  84. +24 −0 test/sources/rtfng/headerFooterDiffPagesAndSections.rtf
  85. +17 −0 test/sources/rtfng/headerFooterSimple.rtf
  86. +17 −0 test/sources/rtfng/paraDefaultPreviousStyle.rtf
  87. +15 −0 test/sources/rtfng/paraHeading.rtf
  88. +19 −0 test/sources/rtfng/paraIndents.rtf
  89. +16 −0 test/sources/rtfng/paraNormal.rtf
  90. +20 −0 test/sources/rtfng/paraTabLeaders.rtf
  91. +16 −0 test/sources/rtfng/paraTabs.rtf
  92. +301 −0 test/sources/rtfng/pictures.rtf
  93. +17 −0 test/sources/rtfng/secondSection.rtf
  94. +15 −0 test/sources/rtfng/sectionEmpty.rtf
  95. +16 −0 test/sources/rtfng/sectionWithBlankPara.rtf
  96. +17 −0 test/sources/rtfng/sectionWithParas.rtf
  97. +15 −0 test/sources/rtfng/sectionWithSmallPara.rtf
  98. +27 −0 test/sources/rtfng/tableFlowLeftToRight.rtf
  99. +27 −0 test/sources/rtfng/tableFlowRightToLeft.rtf
  100. +21 −0 test/sources/rtfng/tableHorizontalCellMerge.rtf
  101. +25 −0 test/sources/rtfng/tableVerticalCellMerge.rtf
  102. +28 −0 test/sources/rtfng/tables.rtf
  103. +38 −0 test/test_all.py
  104. +22 −0 test/test_doctests.py
@@ -0,0 +1,2 @@
+test/sources/rtfng/pending/*
+.coverage
146 ChangeLog
@@ -0,0 +1,146 @@
+2008.06.11
+
+* Added Juanjo Conti's patch to support unicode.
+* Fixed tons of spacing issues.
+* Started cleaning up some of the useless methods.
+* Added a missing call to writeUnicodeElement in the renderer.
+* Updated TODO.
+* Cleaned up whitespace in the renderer.
+
+2008.06.10
+
+* Updated license.
+* Updated commit script.
+
+2008.06.08
+
+* Added a dependencies file.
+* Added missing import in setup.py.
+
+2008.06.07
+
+* Added a notice in the examples directory that the examples are going away.
+* Updated the README with a note about where to lool fofr examples (the test
+directory).
+* Updated the setup.py to find all subpackages.
+
+2008.03.13
+
+* Lots of changes to the automation script.
+* Fixed a syntax error in the script.
+* Moved date var out of python script and into repo vars "script".
+* Added two more values to be passed to the python script.
+* Set the repo vars to production (non-testing) values.
+* Minor code tweaks.
+* Fixed some typos in unfinished code just to get the tests passing.
+* Added support for getting the test name in Python 2.5.
+* Updated the commit script so that tests can actually run.
+* Changed default behaviour for commit script to run tests, skipping if a flag
+is passed (as opposed to only running tests if a flag is passed).
+* Added functions to the commit script for better organziation as well as a
+check for syncing Google code to SourceForge.
+* Removed exit code 1s from python script for convenience of use/parsing by
+other scripts.
+* Removed extraneous trailing slash from scp command.
+* Updated sync script to remove gzip file when done.
+* Updated sync script with messages to stdout as well as the functionality of
+creating a local mirror if one does not already exist.
+* Commented out some testing code.
+
+2008.03.12
+
+* Added scripts for creating a local mirror and syncing that mirror from
+google.
+* Removed extraneous slashes from scripts.
+* Added more variables for use by other scripts (and changed some values for
+testing purposes).
+* Added more scripts for 1) uploading to SF.net, 2) automating the
+form-processing, and 3) controlling the whole process.
+
+2008.03.01
+
+* Started getting the rest of the tests ready.
+
+2008.02.29
+
+* Added a print statement to the generate script.
+* Moved Elements.TAB, .LINE and .RawCode into document.base.
+* Moved Elements.Text and .Inline into document.character.
+* Updated Renderer with these changes.
+* Added a paragraph test.
+* Moved character functions out of Elements and into document.character.
+* Moved character test out of paragraphs tests.
+* Added last paragraph test.
+* First-run clean-up of the character tests.
+* Added the charater tests.
+* Made some initial changes to the table tests.
+
+2008.02.28
+
+* Added a stubbed script for the generation of test RTF docs.
+* Created a place in test/sources for test RTF docs.
+* Made changes to test_all so that it can be imported by other scripts.
+* Made generalizations to test_all, reducing redundancy and increasing
+usability/reusablity.
+* Generated and checked the first reference RTF file.
+* Had to move Paragraph class into new API to avoid circular imports.
+* Renamed all *PS variables to *PropertySet and removed the short names.
+* Added two more test reference RTF files.
+* Updated section unit tests.
+* Removed Paragraph from Elements.
+* Added the next reference RTF file and finished up the last section test.
+* Moved common test case code into utils.RTFTestCase and updated the sections
+test case.
+* Cleaned up imports in section test file.
+* Cleaned up some whitespace in the paragraph file.
+* Started on the paragraph tests.
+* Did some more RTFTestCase abstraction.
+* Updated the generate script.
+* Finished the first para test.
+* Added two more paragraph tests.
+
+2008.02.27
+
+* Moved examples into test dir to serve as the basis for unit tests.
+* Added prototype RTF parsing code from Pecha project.
+* Added TextEdit test RTF files from Mac OS X.
+* Updated TODO.
+* Fixed remaining whitespace issue in setup.py.
+* Created exceptions file.
+* Split grammar into its own file.
+* Made grammar module-level variable (singleton) instead of instantiated class.
+* Updated TODO.
+* Renamed pyrtfng package to rtfng.
+* Added test runner for doctests.
+* Added test runner for all tests, and added doctest suite to the runner.
+* Added a utility module.
+* Added code for recursively adding tests.
+* Added images to be used in tests to test/resources.
+* Updated TODO.
+* Added a write method to Document as a temp fix until the refactor.
+* Started moving some code into the new API in order to avoid circular imports.
+* Removed * imports from rtfng.__init__.py.
+* Removed code from Elements that was copied into the new API.
+* Moved Elements.Standard* into PropertySets (which they all instantiate
+anyway) as part of avoiding circular imports.
+
+2008.02.26
+
+* Copied Simon Cusack's PyRTF code from version 0.45 as the starting point of
+pyrtf-ng.
+* Added ChangeLog.
+* Added admin directory and scripts.
+* Renamed package to pyrtf-ng.
+* Updated setup.py.
+* Added software license.
+* Added a placeholder test directory.
+* Added placeholders for parsing and writing code.
+* Added TODO file.
+* Updated examples to use the new package name and replaced the tabs with
+spaces.
+* Whitespace cleanup.
+* Updated TODO.
+* Fixed name in setup.py.
+* Added gzipped specs for reference.
+* Bumped the version number down until the API changes.
+* TODO reorg and updates.
@@ -0,0 +1 @@
+PyParsing
21 LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2004, Simon Cusak
+Copyright (c) 2008, Duncan McGreggor
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
8 README
@@ -0,0 +1,8 @@
+For example usage, see the code in the unit tests in the 'test' directory and
+its subdirectories.
+
+To run all tests:
+
+ python test/test_all.py
+ python test/test_doctests.py
+
115 TODO
@@ -0,0 +1,115 @@
+Plan
+----
+
+* DONE - Migrate examples to unit tests.
+* DONE - Add prototype parsing code and test sources.
+* DONE - Move exceptions out of parser code into dedicated exceptions file.
+* DONE - Split grammar out of parser base and into its own module.
+* DONE - Rename package from pyrtfng to rtfng.
+* DONE - Update the generate script to accept file names as parameters, thus only
+ generating RTF files for the make_() methods in those files (as opposed to
+ traversing the whole tree).
+* DONE - Add tests for the unicode support.
+* DONE - Increment to version 0.9.1
+
+* Rename varaibles to remove underscores (convert to camelCase).
+* Rename instance variables in PropertySets from UpperCamelCase to
+ lowerCamelCase.
+* Remove extraneous spaces between operators, parens, etc.
+* Add new lines where they should be (no run-ons after colons).
+* Standardize indents to be 4 spaces.
+* Remove deepcopy wherever possible.
+* Increment to version 0.9.2
+
+
+* Rename modules to accord with PEP-8/Twisted coding standard.
+* Rename class methods to accord with PEP-8/Twisted coding standard.
+* Increment to version 0.9.3
+
+* Reorganize package to something along the following lines:
+ rtfng
+ header
+ Version
+ Character Set
+ Font Table
+ Color Table
+ Stylesheet
+ List Table
+ Revisions
+ document
+ section
+ DONE - Section
+ Section Formatting
+ Header/Footer
+ paragraph
+ DONE - Paragraph
+ Formatting/Tabs
+ Bullets/Numbering
+ Borders/Shading
+ Objects/Frames
+ DONE - Table/Cell
+ character
+ Font/Formatting/Properties
+ Borders/Shading
+ Hilighting
+ Special Characters
+ bookmarks
+ objects
+ Pictures
+ Drawings
+ annotations
+ Footnotes
+ Comments
+ fields
+ indices
+ Index
+ Table of Contents
+* Add support for a small subset of the API that does most of what people need,
+ letting users types as few lines as possible to create RTF docs.
+* Increment to version 1.0.0.
+
+* Make classes new-style.
+* Unify the codes in constants.Languages to eliminate redundancy.
+* Increment to version 1.0.1.
+
+* Sort out the character TEXT and Text redundancy.
+* Simplify rendering along the lines of the "write" idiom.
+* Increment to version 1.0.2.
+
+* Add append() method to doc that is a dispatcher, appending to appropriate
+ attrs based on type (e.g., instead of doc.Sections.append(section), one would
+ only need to do doc.append(section)).
+* Increment to version 1.0.3.
+
+* Refactor TabPropertySet leader types into a single attribute.
+* Replace use of apply() with extended call syntax.
+* Increment to version 1.0.4.
+
+* Get parser to the point where it can parse everything the current code can
+ generate.
+* Increment to version 1.1.0.
+
+* Add more RTF-spec support to both the writer and the parser.
+* Increment to version 1.2.0.
+
+
+Completed
+---------
+
+* DONE - Rename package to pyrtfng.
+* DONE - Clean up basic white space issues (mixed tab/space, file encodings,
+ DOS characters, etc.)
+* DONE - Increment to version 0.9.0
+
+
+Issues
+------
+* Tested the initial examples; they don't seem to render properly for TextEdit
+ on Mac OS X.
+* RTF docs should not create any more structure by default than is absolutely
+ necessary:
+ o the auto-creation of the header needs to go;
+ o
+
+Fixed
+-----
@@ -0,0 +1 @@
+0.9.1
@@ -0,0 +1,6 @@
+PYPREFIX=`python -c "import sys;print sys.prefix;"`
+sudo rm -rf ${PYPREFIX}/lib/python2.4/site-packages/adytum/app/pymon
+sudo rm -rf ${PYPREFIX}/lib/python2.4/site-packages/PyMonitor-*.egg
+sudo rm -rf build/
+sudo rm -rf setuptools-*.egg
+sudo find . -name "*.pyc"|xargs rm
Oops, something went wrong.

0 comments on commit 307518c

Please sign in to comment.