diff --git a/MANIFEST.in b/MANIFEST.in index 27da3a9b13fce00d24e2504693c9297bf8f852b6..dfc4c645665f59ed1fe072095cf4de47d10c2359 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,6 +11,8 @@ include process_includes.py include generate_coverage.py include generateDS.html include gends_user_methods.py +include generateds_gui_notes.txt +include generateds_gui_notes.html include Demos/People/people.xsd include Demos/People/people.xml include Demos/People/run_test diff --git a/README b/README index 8328f812efd4525f133de65375a9a2fce5419855..840abf27bc01e46ea830f1ae23c4dc00cc4dcd70 100644 --- a/README +++ b/README @@ -141,6 +141,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Change history -------------- +Version 2.22a (04/11/2016) + +- Added support for additional command line options to + generateds_gui.py. Added analogous support to generateDS.py for + use of session files produced by generateds_gui.py. +- There is now a bit of documentation with a few usage notes on + generateds_gui.py. See generateds_gui_notes.txt and + generateds_gui_notes.html. + Version 2.21a (04/01/2016) - The GUI (graphical) front end to generateDS.py has been diff --git a/generateDS.html b/generateDS.html index 903478ea2008bf9e02870dfc7e884d96434dcf4e..00c93c257b48d4bc93f7dd65abad6d22368c90aa 100644 --- a/generateDS.html +++ b/generateDS.html @@ -220,7 +220,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">revision:</th><td class="field-body">2.21a</td> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.22a</td> </tr> </tbody> </table> @@ -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 01, 2016</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">April 11, 2016</td> </tr> </tbody> </table> @@ -3171,7 +3171,7 @@ following among others:</p> <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateDS.txt">View document source</a>. -Generated on: 2016-04-01 18:00 UTC. +Generated on: 2016-04-11 21:46 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 e63e492631e33ec8c96707ded22a2a309480c1b3..89166d0eb26cb786da916813f02d2e1ec013607d 100755 --- a/generateDS.py +++ b/generateDS.py @@ -202,7 +202,7 @@ logging.disable(logging.INFO) # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## -VERSION = '2.21a' +VERSION = '2.22a' ##VERSION## if sys.version_info.major == 2: diff --git a/generateDS.txt b/generateDS.txt index 8add02e764433662836fb50fe3106ae14152608f..8f1bf292fd09ca57c2f87bb7eacce9e044e99057 100644 --- a/generateDS.txt +++ b/generateDS.txt @@ -12,7 +12,7 @@ generateDS -- Generate Data Structures from XML Schema .. version -:revision: 2.21a +:revision: 2.22a .. version diff --git a/generateds_gui_notes.html b/generateds_gui_notes.html new file mode 100644 index 0000000000000000000000000000000000000000..bc5e0c21d83a70e6b69d3b7afabad57fa415a4fe --- /dev/null +++ b/generateds_gui_notes.html @@ -0,0 +1,343 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.13: http://docutils.sourceforge.net/" /> +<title>GenerateDS GUI Notes</title> +<meta name="author" content="Dave Kuhlman" /> +<style type="text/css"> + +/* css */ + +body { + font: 90% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + background: #ffffff; + color: black; + margin: 2em; + padding: 2em; +} + +a[href] { + color: #436976; + background-color: transparent; +} + +a.toc-backref { + text-decoration: none; +} + +h1 a[href] { + text-decoration: none; + color: #fcb100; + background-color: transparent; +} + +a.strong { + font-weight: bold; +} + +img { + margin: 0; + border: 0; +} + +p { + margin: 0.5em 0 1em 0; + line-height: 1.5em; +} +p a { + text-decoration: underline; +} +p a:visited { + color: purple; + background-color: transparent; +} +p a:active { + color: red; + background-color: transparent; +} +a:hover { + text-decoration: none; +} +p img { + border: 0; + margin: 0; +} + +h1, h2, h3, h4, h5, h6 { + color: #003a6b; + background-color: transparent; + font: 100% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + margin: 0; + padding-top: 0.5em; +} + +h1 { + font-size: 160%; + margin-bottom: 0.5em; + border-bottom: 1px solid #fcb100; +} +h2 { + font-size: 140%; + margin-bottom: 0.5em; + border-bottom: 1px solid #aaa; +} +h3 { + font-size: 130%; + margin-bottom: 0.5em; + text-decoration: underline; +} +h4 { + font-size: 110%; + font-weight: bold; +} +h5 { + font-size: 100%; + font-weight: bold; +} +h6 { + font-size: 80%; + font-weight: bold; +} + +ul a, ol a { + text-decoration: underline; +} + +dt { + font-weight: bold; +} +dt a { + text-decoration: none; +} + +dd { + line-height: 1.5em; + margin-bottom: 1em; +} + +legend { + background: #ffffff; + padding: 0.5em; +} + +form { + margin: 0; +} + + +dl.form { + margin: 0; + padding: 1em; +} + +dl.form dt { + width: 30%; + float: left; + margin: 0; + padding: 0 0.5em 0.5em 0; + text-align: right; +} + +input { + font: 100% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + color: black; + background-color: white; + vertical-align: middle; +} + +abbr, acronym, .explain { + color: black; + background-color: transparent; +} + +q, blockquote { +} + +code, pre { + font-family: monospace; + font-size: 1.2em; + display: block; + padding: 10px; + border: 1px solid #838183; + background-color: #eee; + color: #000; + overflow: auto; + margin: 0.5em 1em; +} + +div.admonition, div.attention, div.caution, div.danger, div.error, +div.hint, div.important, div.note, div.tip, div.warning { + margin: 2em ; + border: medium outset ; + padding: 1em } + +div.admonition p.admonition-title, div.hint p.admonition-title, +div.important p.admonition-title, div.note p.admonition-title, +div.tip p.admonition-title { + font-weight: bold ; + font-family: sans-serif } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title { + color: red ; + font-weight: bold ; + font-family: sans-serif } + +tt.docutils { + background-color: #dddddd; +} + +ul.auto-toc { + list-style-type: none } + +</style> +</head> +<body> +<div class="document" id="generateds-gui-notes"> +<h1 class="title">GenerateDS GUI Notes</h1> +<table class="docinfo" frame="void" rules="none"> +<col class="docinfo-name" /> +<col class="docinfo-content" /> +<tbody valign="top"> +<tr><th class="docinfo-name">Author:</th> +<td>Dave Kuhlman</td></tr> +<tr><th class="docinfo-name">Contact:</th> +<td>dkuhlman (at) davekuhlman (dot) org</td></tr> +<tr><th class="docinfo-name">Address:</th> +<td><pre class="address"> +<a class="first last reference external" href="http://www.davekuhlman.org">http://www.davekuhlman.org</a> +</pre> +</td></tr> +</tbody> +</table> +<!-- Do not modify the following version comments. +They are used by updateversion.py. --> +<!-- version --> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.22a</td> +</tr> +</tbody> +</table> +<!-- version --> +<table class="docutils field-list" frame="void" rules="none"> +<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 11, 2016</td> +</tr> +</tbody> +</table> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name">copyright:</th><td class="field-body">Copyright (c) 2016 Dave Kuhlman. This documentation +and the software it describes is covered by The MIT License: +<a class="reference external" href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>.</td> +</tr> +<tr class="field"><th class="field-name">abstract:</th><td class="field-body">This document describes generateds_ui.py, the graphical +front end to generateDS.py.</td> +</tr> +</tbody> +</table> +<div class="section" id="introduction"> +<h1>Introduction</h1> +<p><tt class="docutils literal">generateds_gui.py</tt> provides a graphical front end for +<tt class="docutils literal">generateDS.py</tt>. Some may find it easier to configure and to +select and set options for <tt class="docutils literal">generateDS.py</tt> using this graphical +application.</p> +</div> +<div class="section" id="requirements"> +<h1>Requirements</h1> +<p>You will need Gtk support for Python in order to run +<tt class="docutils literal">generateds_gui.py</tt>.</p> +<p>You must run <tt class="docutils literal">generateds_gui.py</tt> under Python 3. Python 2 is not +supported.</p> +<p>Note that you can use the "--session" command line flag supported by +<tt class="docutils literal">generateDS.py</tt> on a machine that does not have Python Gtk support +installed.</p> +</div> +<div class="section" id="usage-notes"> +<h1>Usage notes</h1> +<div class="section" id="what-it-does"> +<h2>What it does</h2> +<p>Here are some of the different ways that you can use +<tt class="docutils literal">generateds_gui.py</tt>:</p> +<ol class="arabic simple"> +<li>You can generate modules from within <tt class="docutils literal">generateds_gui.py</tt> using +the "Generate" item in the "Tools" menu.</li> +<li>You can produce and view a command line that reflects your +configuration using the "Generate CL" item in the "Tools" menu, +and then you can copy and paste the resulting command line into a +<tt class="docutils literal">bash</tt> script (for Linux) or a <tt class="docutils literal">.bat</tt> file (for MS Windows), +which you can then run from the command line.</li> +<li>You can run the session file that you've saved with the +"--session" command line flag supported by <tt class="docutils literal">generateDS.py</tt>.</li> +<li>You can load a previously saved session file into +<tt class="docutils literal">generateds_gui.py</tt> using the "--session" command line option, +and then modify that session and/or use it to generate modules, +or to generate a command line.</li> +</ol> +</div> +<div class="section" id="how-to-use-it"> +<h2>How to use it</h2> +<p>You can get some help by running the following:</p> +<pre class="literal-block"> +$ ./generateds_gui.py --help +</pre> +<p>Command line options and arguments:</p> +<pre class="literal-block"> +Usage: +python generateds_gui.py [options] --session=<some_session_file.session> +example: + python generateds_gui.py --session=generator01.session +Options: + -h, --help show this help message and exit + --exec-path=EXEC_PATH + path to executable generated in command line. + Example: "python /path/to/generateDS.py". Default: + "./generateDS.py". Use Tools/Generate CL (Ctrl-T) to + see it. + --impl-gui=IMPL_GUI name of glade file that defines the GUI if not + embedded. + -s SESSION, --session=SESSION + name of a session file to be loaded. +</pre> +<dl class="docutils"> +<dt>exec-path</dt> +<dd>If your copy of <tt class="docutils literal">generateDS.py</tt> is in a special location, you +can specify that location using this option. The version of +<tt class="docutils literal">generateDS.py</tt> at that location will be run when you select +the "Generate" item from the "Tools" menu.</dd> +<dt>impl-gui</dt> +<dd>The file <tt class="docutils literal">generateds_gui.glade</tt> specifies and describes the +user interface. This file has been embedded into +<tt class="docutils literal">generateds_gui.py</tt>. If you modify <tt class="docutils literal">generateds_gui.glade</tt> +and want to use that modified version, specify it with this +option.</dd> +<dt>s, session</dt> +<dd>If you have created and saved a session file using +<tt class="docutils literal">generateds_gui.py</tt> and want to load that file the next time +you run <tt class="docutils literal">generateds_gui.py</tt>, use this option. Alternatively, +once <tt class="docutils literal">generateds_gui.py</tt> has been started, you can use the +"Load session" item under the "File" menu.</dd> +</dl> +<!-- vim:ft=rst: --> +</div> +</div> +</div> +<div class="footer"> +<hr class="footer" /> +<a class="reference external" href="generateds_gui_notes.txt">View document source</a>. +Generated on: 2016-04-11 21:46 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> +</body> +</html> diff --git a/generateds_gui_notes.txt b/generateds_gui_notes.txt new file mode 100644 index 0000000000000000000000000000000000000000..6c816b9eb2418d443ea6acdfc4a00bda7abc00f9 --- /dev/null +++ b/generateds_gui_notes.txt @@ -0,0 +1,126 @@ +====================== +GenerateDS GUI Notes +====================== + +:author: Dave Kuhlman +:contact: dkuhlman (at) davekuhlman (dot) org +:address: + http://www.davekuhlman.org + +.. Do not modify the following version comments. + They are used by updateversion.py. + +.. version + +:revision: 2.22a + +.. version + +:date: |date| + +.. |date| date:: %B %d, %Y + + +:copyright: Copyright (c) 2016 Dave Kuhlman. This documentation + and the software it describes is covered by The MIT License: + http://www.opensource.org/licenses/mit-license.php. + +:abstract: This document describes generateds_ui.py, the graphical + front end to generateDS.py. + +Introduction +============== + +``generateds_gui.py`` provides a graphical front end for +``generateDS.py``. Some may find it easier to configure and to +select and set options for ``generateDS.py`` using this graphical +application. + + +Requirements +============== + +You will need Gtk support for Python in order to run +``generateds_gui.py``. + +You must run ``generateds_gui.py`` under Python 3. Python 2 is not +supported. + +Note that you can use the "--session" command line flag supported by +``generateDS.py`` on a machine that does not have Python Gtk support +installed. + + +Usage notes +============= + +What it does +-------------- + +Here are some of the different ways that you can use +``generateds_gui.py``: + +#. You can generate modules from within ``generateds_gui.py`` using + the "Generate" item in the "Tools" menu. + +#. You can produce and view a command line that reflects your + configuration using the "Generate CL" item in the "Tools" menu, + and then you can copy and paste the resulting command line into a + ``bash`` script (for Linux) or a ``.bat`` file (for MS Windows), + which you can then run from the command line. + +#. You can run the session file that you've saved with the + "--session" command line flag supported by ``generateDS.py``. + +#. You can load a previously saved session file into + ``generateds_gui.py`` using the "--session" command line option, + and then modify that session and/or use it to generate modules, + or to generate a command line. + + +How to use it +--------------- + +You can get some help by running the following:: + + $ ./generateds_gui.py --help + +Command line options and arguments:: + + Usage: + python generateds_gui.py [options] --session=<some_session_file.session> + example: + python generateds_gui.py --session=generator01.session + Options: + -h, --help show this help message and exit + --exec-path=EXEC_PATH + path to executable generated in command line. + Example: "python /path/to/generateDS.py". Default: + "./generateDS.py". Use Tools/Generate CL (Ctrl-T) to + see it. + --impl-gui=IMPL_GUI name of glade file that defines the GUI if not + embedded. + -s SESSION, --session=SESSION + name of a session file to be loaded. + +exec-path + If your copy of ``generateDS.py`` is in a special location, you + can specify that location using this option. The version of + ``generateDS.py`` at that location will be run when you select + the "Generate" item from the "Tools" menu. + +impl-gui + The file ``generateds_gui.glade`` specifies and describes the + user interface. This file has been embedded into + ``generateds_gui.py``. If you modify ``generateds_gui.glade`` + and want to use that modified version, specify it with this + option. + +s, session + If you have created and saved a session file using + ``generateds_gui.py`` and want to load that file the next time + you run ``generateds_gui.py``, use this option. Alternatively, + once ``generateds_gui.py`` has been started, you can use the + "Load session" item under the "File" menu. + +.. vim:ft=rst: diff --git a/gui/generateds_gui.py b/gui/generateds_gui.py index 70a191a3ef9461cbd6abe45ef0c38d23a04e5de9..1c958146b1765c54eccf338e47011a0a9c2f1645 100755 --- a/gui/generateds_gui.py +++ b/gui/generateds_gui.py @@ -39,7 +39,7 @@ from libgenerateDS.gui import generateds_gui_session # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## -VERSION = '2.21a' +VERSION = '2.22a' ##VERSION## @@ -1020,9 +1020,9 @@ def capture_ui_names(): USAGE_TEXT = """ - python %prog [options] <somefile.xxx> + python %prog [options] --session=<some_session_file.session> example: - python %prog somefile.xxx""" + python %prog --session=generator01.session""" def usage(parser): diff --git a/librarytemplate_howto.html b/librarytemplate_howto.html index f89453dcacfac738b506e99f9a4457c22dad75ad..3a70634222e8599bec01ba0fad997494bf0fbf4f 100644 --- a/librarytemplate_howto.html +++ b/librarytemplate_howto.html @@ -217,7 +217,7 @@ dkuhlman (at) davekuhlman (dot) org <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.21a</td> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.22a</td> </tr> </tbody> </table> @@ -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 01, 2016</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">April 11, 2016</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: 2016-04-01 18:00 UTC. +Generated on: 2016-04-11 21:46 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.txt b/librarytemplate_howto.txt index ffd074b71c4caec0e55050ac1dc384c808b24e6c..a8e999284ae13c026f06d52977673890d365f538 100644 --- a/librarytemplate_howto.txt +++ b/librarytemplate_howto.txt @@ -8,7 +8,7 @@ How to package a generateDS.py generated library .. version -:revision: 2.21a +:revision: 2.22a .. version diff --git a/process_includes.py b/process_includes.py index 27708999c5bf6b29e0f33e47e6789d4053e75260..e60f2ec1d79f35c359b114663fe696d568491004 100755 --- a/process_includes.py +++ b/process_includes.py @@ -40,7 +40,7 @@ except ImportError: # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## -VERSION = '2.21a' +VERSION = '2.22a' ##VERSION## CatalogDict = {} diff --git a/setup.py b/setup.py index ed4dc1d84b7ae6e7d55c9f57a50fea5293470ca3..1c45b738415f87a723823f9eb71447f6df94965a 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup(name="generateDS", # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## - version="2.21a", + version="2.22a", ##VERSION## author="Dave Kuhlman", author_email="dkuhlman@davekuhlman.org", diff --git a/tutorial/generateds_tutorial.html b/tutorial/generateds_tutorial.html index b390c1ec12b59b817febfd8338a6c6d92a2ba3fc..a0f0cf8ae26ff4ad8570491b1bcf9098c060deec 100644 --- a/tutorial/generateds_tutorial.html +++ b/tutorial/generateds_tutorial.html @@ -219,7 +219,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">revision:</th><td class="field-body">2.21a</td> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.22a</td> </tr> </tbody> </table> @@ -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 01, 2016</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">April 11, 2016</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: 2016-04-01 18:00 UTC. +Generated on: 2016-04-11 21:46 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.txt b/tutorial/generateds_tutorial.txt index d526c01ee60ab0e6d7b276b43ced5b6ec9f0cbae..c6e47bef04774ce42608fea4d4b93632b819b8e9 100644 --- a/tutorial/generateds_tutorial.txt +++ b/tutorial/generateds_tutorial.txt @@ -11,7 +11,7 @@ generateDS -- Introduction and Tutorial .. version -:revision: 2.21a +:revision: 2.22a .. version diff --git a/tutorial/generateds_tutorial.zip b/tutorial/generateds_tutorial.zip index 233f9d6a7c04b4859b0250516e4adac39f2de367..e6854f576594abe649425cbf7c8bcdea35ddf43a 100644 Binary files a/tutorial/generateds_tutorial.zip and b/tutorial/generateds_tutorial.zip differ diff --git a/updateversion.py b/updateversion.py index b122794cdea2956bd88d9ee523b41c289fd87dc9..0ec261804c54d002002df424aabdffbf9f79f38f 100755 --- a/updateversion.py +++ b/updateversion.py @@ -45,10 +45,8 @@ REPL_SPEC = [ 'pattern': r"(.. version\s*:revision: )([\w\.\-]*)(\s*.. version)", }, { - 'filename': 'generateDS.txt', - 'pattern': r"(\.\. version\s*- My Web site -- \s*" - r"http://www\.rexx\.com/~dkuhlman/generateDS-)" - r"([\w\.\-]*)(\.tar\.gz\s*\.\. version)", + 'filename': 'generateds_gui_notes.txt', + 'pattern': r"(.. version\s*:revision: )([\w\.\-]*)(\s*.. version)", }, { 'filename': 'librarytemplate_howto.txt', @@ -84,23 +82,21 @@ def updateversion(version): update1file(targetfilename, content1) - -# # Classes - # # Functions for internal use and testing def update1file(targetfilename, content): - backupfilename = targetfilename + '.bak' + backupfilename = targetfilename + '.bak' shutil.copy2(targetfilename, backupfilename) targetfile = open(targetfilename, 'w') targetfile.write(content) targetfile.close() #shutil.copymode(backupfilename, targetfilename) + def replfuncmaker(version): def replfunc(matchobj): if VERBOSE: @@ -111,6 +107,7 @@ def replfuncmaker(version): USAGE_TEXT = __doc__ + def usage(): print USAGE_TEXT sys.exit(1) @@ -140,4 +137,3 @@ def main(): if __name__ == '__main__': #import pdb; pdb.set_trace() main() -