diff --git a/README.rst b/README.rst index 4af7898195385c7c3c1f6f7517451e6737404491..f352ecfcb8fab295c2fba3bf4a91e174a15a5812 100644 --- a/README.rst +++ b/README.rst @@ -141,7 +141,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Change history -------------- -Version 2.26a (05/01/2017) +Version 2.26a (05/09/2017) - Added command line options --no-collect-includes and --no-redefine-groups. These options selectively turn off tasks @@ -153,7 +153,12 @@ Version 2.26a (05/01/2017) Florian Wilmshoever for reporting and working with me on this. - Moved README to README.rst so that hopefully Bitbucket will render it as reStructuredText (with Docutils). Also, fixed a - number of reST/Docutils errors in README.rst + number of reST/Docutils errors in README.rst. +- Another fix for unicode encoding in process_includes.py. +- A bug was uncovered when the "-o" command line option is omitted + and the Python version is 3. Added a check that forces the use of + the "-o" option unless the one-per option is included. Thanks to + Oskari Petas for reporting this. Version 2.25a (03/21/2017) diff --git a/generateDS.html b/generateDS.html index 535d850f436912a4613464976f78c03f83ffb19c..cd00184dbc45e790e32604e215a32360b28910d0 100644 --- a/generateDS.html +++ b/generateDS.html @@ -229,7 +229,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">May 02, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> </tr> </tbody> </table> @@ -3235,7 +3235,7 @@ following among others:</p> <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateDS.txt">View document source</a>. -Generated on: 2017-05-02 19:14 UTC. +Generated on: 2017-05-09 21:57 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/generateDS.py b/generateDS.py index 693cef95242fa646ea4a5c0eb8dd383c763efa0d..54f26f7f7ae9fd577ec71ebbdfa3e7fefff058e5 100755 --- a/generateDS.py +++ b/generateDS.py @@ -6546,8 +6546,7 @@ def generate(outfileName, subclassFilename, behaviorFilename, MappingTypes.clear() AlreadyGenerated = set() outfile = None - if outfileName: - outfile = makeFile(outfileName) + outfile = makeFile(outfileName) if not outfile: outfile = os.tmpfile() wrt = outfile.write @@ -6574,6 +6573,8 @@ def generate(outfileName, subclassFilename, behaviorFilename, if not isNewState(): sys.stderr.write('\n*** maxLoops exceeded. Something is ' 'wrong with --one-file-per-xsd.\n\n') + sys.stderr.write('*** Failed to process the following element ' + 'definitions:\n %s\n' % (PostponedExtensions)) break element = PostponedExtensions.pop() parentName, parent = getParentName(element) @@ -7197,6 +7198,8 @@ def main(): TEMPLATE_MAIN = fixSilence(TEMPLATE_MAIN, silent) TEMPLATE_SUBCLASS_FOOTER = fixSilence(TEMPLATE_SUBCLASS_FOOTER, silent) load_config() + if outFilename is None and SingleFileOutput: + sys.exit('\nMissing required option "-o" (output module name)\n') parseAndGenerate( outFilename, subclassFilename, diff --git a/generateds_gui_notes.html b/generateds_gui_notes.html index 58e6b4e20855bf8cfd05969f8cf5911bc6202883..a34f76b1c8a5e1d0240aedf76fb1a1052bb7a1bf 100644 --- a/generateds_gui_notes.html +++ b/generateds_gui_notes.html @@ -229,7 +229,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">April 28, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> </tr> </tbody> </table> @@ -401,7 +401,7 @@ $ mv generateds_gui.mo locale/ru/LC_MESSAGES/ <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateds_gui_notes.txt">View document source</a>. -Generated on: 2017-04-28 21:54 UTC. +Generated on: 2017-05-09 21:57 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/librarytemplate_howto.html b/librarytemplate_howto.html index b5fa21220f076c9398bdb783924c8bd6a05f0618..5d3738abc667233576c78d8b99a04883228aafc4 100644 --- a/librarytemplate_howto.html +++ b/librarytemplate_howto.html @@ -226,7 +226,7 @@ dkuhlman (at) davekuhlman (dot) org <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">April 28, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> </tr> </tbody> </table> @@ -380,7 +380,7 @@ this command for your needs. For example, you may need to use <div class="footer"> <hr class="footer" /> <a class="reference external" href="librarytemplate_howto.txt">View document source</a>. -Generated on: 2017-04-28 21:54 UTC. +Generated on: 2017-05-09 21:57 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/process_includes.py b/process_includes.py index 17539a0abc2c4f21b9cc6ed877281d1bad9f945e..e030a21d45a8dff9bb41e29d3e8869c17d381c5d 100755 --- a/process_includes.py +++ b/process_includes.py @@ -213,7 +213,11 @@ def resolve_ref(node, params, options): else: if os.path.exists(locn): infile = open(locn) - content = infile.read().encode() + unencoded_content = infile.read() + if sys.version_info.major == 2: + content = unencoded_content + else: + content = unencoded_content.encode() infile.close() params.parent_url = locn params.base_url = os.path.split(locn)[0] diff --git a/tutorial/generateds_tutorial.html b/tutorial/generateds_tutorial.html index 1aa034103fc9040d0c8ea6b86fcbad1b5dd3f6d5..4ee1307a50fe4dadabb3be865ec6694e242ffcd4 100644 --- a/tutorial/generateds_tutorial.html +++ b/tutorial/generateds_tutorial.html @@ -228,7 +228,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">April 28, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> </tr> </tbody> </table> @@ -1210,7 +1210,7 @@ named <tt class="docutils literal">garden_api.py</tt>, you can create an instanc <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateds_tutorial.txt">View document source</a>. -Generated on: 2017-04-28 21:54 UTC. +Generated on: 2017-05-09 21:57 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/tutorial/generateds_tutorial.zip b/tutorial/generateds_tutorial.zip index 5ac7b6ccf4e3a8b441ef4d6e00a77c913ecfe37a..490a139bad4144c6118c1b4a99694371778130b9 100644 Binary files a/tutorial/generateds_tutorial.zip and b/tutorial/generateds_tutorial.zip differ