You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(13) |
Aug
(17) |
Sep
|
Oct
(9) |
Nov
(1) |
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
(27) |
May
(10) |
Jun
(6) |
Jul
(1) |
Aug
(3) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(9) |
Jun
(26) |
Jul
(23) |
Aug
(2) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Frederik 'F. S. O. <fr...@us...> - 2006-03-01 13:51:31
|
Update of /cvsroot/optik/optik/po In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14389 Modified Files: optik.da.po Log Message: Minor updates to the Danish translation file. (Is this repository even kept anymore, or has work been moved to the official Python repos?) Index: optik.da.po =================================================================== RCS file: /cvsroot/optik/optik/po/optik.da.po,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- optik.da.po 2 Jul 2004 17:21:31 -0000 1.2 +++ optik.da.po 1 Mar 2006 13:51:26 -0000 1.3 @@ -1,15 +1,17 @@ -# Copyright (C) 2004 Python Software Foundation -# Frederik 'Freso' S. Olesen <fr...@li...>, 2004. -# +# Copyright (C) 2004 Python Software Foundation +# Greg Ward <gw...@py...>, 2004. +# Frederik 'Freso' S. Olesen <fre...@gm...>, 2006. +# msgid "" msgstr "" "Project-Id-Version: Optik 1.5\n" +"Report-Msgid-Bugs-To: \n" "POT-Creation-Date: Thu Jun 3 21:53:18 2004\n" -"PO-Revision-Date: 2004-06-16 23:37+0200\n" -"Last-Translator: Frederik 'Freso' S. Olesen <fr...@li...>\n" +"PO-Revision-Date: 2006-03-01 14:45+0100\n" +"Last-Translator: Frederik 'Freso' S. Olesen <fre...@gm...>\n" "Language-Team: Danish <da...@kl...>\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/help.py:203 @@ -56,22 +58,19 @@ msgid "%prog [options]" msgstr "%prog [tilvalg]" -#: lib/option_parser.py:655 -#: lib/option_parser.py:694 +#: lib/option_parser.py:655 lib/option_parser.py:694 msgid "%s option requires an argument" -msgstr "\"%s\"-tilvalget kræver et argument" +msgstr "tilvalget \"%s\" kræver et argument" -#: lib/option_parser.py:657 -#: lib/option_parser.py:696 +#: lib/option_parser.py:657 lib/option_parser.py:696 msgid "%s option requires %d arguments" -msgstr "\"%s\"-tilvalget kræver %d argumenter" +msgstr "tilvalget \"%s\" kræver %d argumenter" #: lib/option_parser.py:666 msgid "%s option does not take a value" msgstr "tilvalget \"%s\" skal ikke tildeles nogen værdi" -#: lib/option_parser.py:683 -#: lib/option_parser.py:827 +#: lib/option_parser.py:683 lib/option_parser.py:827 msgid "no such option: %s" msgstr "intet tilvalg: %s" |
|
From: Greg W. <gw...@us...> - 2004-09-24 01:59:17
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8955 Modified Files: mkpydoc Log Message: Simplify _em_dash_re so it only matches em-dashes as I type them, ie. " -- ". Fix visit_Text() so it converts them to \u2014 (Unicode em-dash), which is handled correctly by encode() in the superclass. Fix visit_literal() so it puts the munged text back in the node from which it came. Index: mkpydoc =================================================================== RCS file: /cvsroot/optik/optik/mkpydoc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mkpydoc 23 Sep 2004 01:26:28 -0000 1.4 +++ mkpydoc 24 Sep 2004 01:59:03 -0000 1.5 @@ -184,7 +184,7 @@ def visit_literal(self, node): assert isinstance(node[0], nodes.Text) - text = node[0].astext() + text = node[0].data if self.in_title: cmd = None elif self._quoted_string_re.match(text): @@ -204,6 +204,7 @@ cmd = 'code' self.literal = 1 + node[0].data = text if cmd is not None: self.body.append('\\%s{' % cmd) @@ -266,11 +267,11 @@ self.body.append("section~\\ref{%s}, " % label) raise nodes.SkipDeparture - _em_dash_re = re.compile(r'\b\s*\-\-\-?\s*\b') + _em_dash_re = re.compile(r'\s+\-\-\s+') def visit_Text(self, node): text = node.astext() - text = self._em_dash_re.sub("---", text) # does this belong in encode()? + text = self._em_dash_re.sub(u"\u2014", text) self.body.append(self.encode(text)) def depart_Text(self, node): |
|
From: Greg W. <gw...@us...> - 2004-09-23 01:26:46
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24474 Modified Files: mkpydoc Log Message: latex2e.writer.Writer now has a translator_class attribute -- take advantage of it to simplify my PyLaTeXWriter class. Index: mkpydoc =================================================================== RCS file: /cvsroot/optik/optik/mkpydoc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mkpydoc 23 Sep 2004 01:08:47 -0000 1.3 +++ mkpydoc 23 Sep 2004 01:26:28 -0000 1.4 @@ -13,17 +13,10 @@ from docutils import nodes class PyLaTeXWriter(LaTeXWriter): - def translate(self): - # ugh, copy-n-pasted from docutils.writers.latex2e.Writer.translate() - visitor = PyLaTeXTranslator(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - self.head_prefix = visitor.head_prefix - self.head = visitor.head - self.body_prefix = visitor.body_prefix - self.body = visitor.body - self.body_suffix = visitor.body_suffix - + def __init__(self): + LaTeXWriter.__init__(self) + self.translator_class = PyLaTeXTranslator + class PyLaTeXTranslator(LaTeXTranslator): codemarkup = { # Methods of OptionParser, Option, Values, ... @@ -312,20 +305,10 @@ pub.set_destination(destination_path=outfilename) pub.publish() - def main(): - sources = ["intro.txt", - "tao.txt", - "basic.txt", - "advanced.txt", - "callbacks.txt", - "extending.txt"] - concat_sources = "tmp/optik.txt" - if newer_group(sources, concat_sources): - concatenate_sources(sources, concat_sources) - outfilename = "tmp/optik.tex" - if 1 or newer(concat_sources, outfilename): - convert(concat_sources, outfilename) + if not os.path.isdir("tmp"): + os.mkdir("tmp") + convert("optik.txt", outfilename) main() |
|
From: Greg W. <gw...@us...> - 2004-09-23 01:11:33
|
Update of /cvsroot/optik/optik/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21988/lib Modified Files: option_parser.py Log Message: Add __str__(), and use _repr() from option.py. Index: option_parser.py =================================================================== RCS file: /cvsroot/optik/optik/lib/option_parser.py,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- option_parser.py 24 Jul 2004 23:21:21 -0000 1.67 +++ option_parser.py 23 Sep 2004 01:11:21 -0000 1.68 @@ -9,7 +9,7 @@ import sys, os import types from gettext import gettext as _ -from optik.option import Option, NO_DEFAULT +from optik.option import Option, NO_DEFAULT, _repr from optik.help import IndentedHelpFormatter from optik.errors import OptionConflictError, OptionValueError, BadOptionError @@ -40,9 +40,10 @@ for (attr, val) in defaults.items(): setattr(self, attr, val) - def __repr__(self): - return ("<%s at 0x%x: %r>" - % (self.__class__.__name__, id(self), self.__dict__)) + def __str__(self): + return str(self.__dict__) + + __repr__ = _repr def __eq__(self, other): if isinstance(other, Values): |
|
From: Greg W. <gw...@us...> - 2004-09-23 01:10:32
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21781 Modified Files: MANIFEST.in Log Message: Exclude intro.txt. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/optik/optik/MANIFEST.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MANIFEST.in 24 Jul 2004 22:02:13 -0000 1.5 +++ MANIFEST.in 23 Sep 2004 01:10:23 -0000 1.6 @@ -1,4 +1,5 @@ include *.txt *.html +exclude intro.txt include optparse.py exclude ./*.py include test/test*.py |
|
From: Greg W. <gw...@us...> - 2004-09-23 01:09:46
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21532 Modified Files: extending.txt Log Message: Better explanation of type-checking functions. Index: extending.txt =================================================================== RCS file: /cvsroot/optik/optik/extending.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- extending.txt 25 May 2004 00:14:37 -0000 1.8 +++ extending.txt 23 Sep 2004 01:09:35 -0000 1.9 @@ -24,13 +24,15 @@ ``TYPE_CHECKER`` is a dictionary mapping type names to type-checking functions. A type-checking function has the following signature:: - def check_foo(option : Option, opt : string, value : string) : foo + def check_mytype(option, opt, value) -You can name it whatever you like, and make it return any type you like -(e.g. the hypothetical type ``foo``). The value returned by a -type-checking function will wind up in the OptionValues instance -returned by ``OptionParser.parse_args()``, or be passed to callbacks as -the ``value`` parameter. +where ``option`` is an ``Option`` instance, ``opt`` is an option string +(e.g., ``"-f"``), and ``value`` is the string from the command line that +must be checked and converted to your desired type. ``check_mytype()`` +should return an object of the hypothetical type ``mytype``. The value +returned by a type-checking function will wind up in the OptionValues +instance returned by ``OptionParser.parse_args()``, or be passed to a +callback as the ``value`` parameter. Your type-checking function should raise OptionValueError if it encounters any problems. OptionValueError takes a single string |
|
From: Greg W. <gw...@us...> - 2004-09-23 01:09:07
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21343 Modified Files: mkpydoc Log Message: Uncomment a few .txt files from the concatenation. Index: mkpydoc =================================================================== RCS file: /cvsroot/optik/optik/mkpydoc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mkpydoc 26 Aug 2004 00:47:38 -0000 1.2 +++ mkpydoc 23 Sep 2004 01:08:47 -0000 1.3 @@ -315,10 +315,10 @@ def main(): sources = ["intro.txt", - #"tao.txt", + "tao.txt", "basic.txt", - #"advanced.txt", - #"callbacks.txt", + "advanced.txt", + "callbacks.txt", "extending.txt"] concat_sources = "tmp/optik.txt" if newer_group(sources, concat_sources): |
|
From: Greg W. <gw...@us...> - 2004-09-23 01:07:04
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20867 Added Files: mkhtml Removed Files: mkdoc Log Message: Rename mkdoc to mkhtml. --- mkdoc DELETED --- --- NEW FILE: mkhtml --- #!/usr/bin/python # Convert the Optik docs to HTML import sys, os from glob import glob from distutils.dep_util import newer from docutils.core import publish_file args = sys.argv[1:] if not args: sys.exit("usage: mkdoc outdir") outdir = args[0] for filename in glob("[a-z]*.txt"): outname = os.path.join(outdir, filename.replace(".txt", ".html")) if newer(filename, outname): print "converting %s to %s" % (filename, outname) publish_file(source_path=filename, destination_path=outname, writer_name='html') |
|
From: Greg W. <gw...@us...> - 2004-08-26 00:47:47
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10748 Modified Files: mkpydoc Log Message: First version to generate LaTeX output that can be included by Python's Doc/lib/lib.tex: * added more optparse-specific class attrs * set head_prefix sensibly from them * add mangle_title() to turn section titles into LaTeX labels * don't look for :VersionAdded: -- it's a class attr now * modify many existing visitors * add vistors for 'target', 'definition', 'definition_list_item', 'reference', 'Text' Index: mkpydoc =================================================================== RCS file: /cvsroot/optik/optik/mkpydoc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mkpydoc 23 Aug 2004 02:01:44 -0000 1.1 +++ mkpydoc 26 Aug 2004 00:47:38 -0000 1.2 @@ -96,11 +96,26 @@ 'filename' : 'var', } + # XXX need to factor this out + module_name = "optparse" + module_summary = "Powerful parser for command line options." + module_type = "standard" + module_author = "Greg Ward" + module_author_email = "gw...@py..." + module_synopsis = ("Powerful, flexible, extensible, easy-to-use " + "command-line parsing library.") + version_added = "2.3" + + refuri_override = { + "extending.html" : "optparse-extending", + } + def __init__(self, document): LaTeXTranslator.__init__(self, document) self.head_prefix = [] self.head = [] self.body_prefix = [] + self.in_title = False # Disable a bunch of methods from the base class. empty_method = lambda self: None @@ -111,18 +126,14 @@ setattr(self, 'visit_' + nodetype, empty_method) setattr(self, 'depart_' + nodetype, empty_method) -# self.head_prefix = ["""\ -# \\section{\\module{optparse} --- Powerful command line option parser.} - -# \\declaremodule{standard}{optparse} -# \\moduleauthor{Greg Ward}{gw...@py...} -# \\sectionauthor{Greg Ward}{gw...@py...} - -# \\modulesynopsis{Powerful, flexible, extensible, easy-to-use command-line -# parsing library.} - -# \\versionadded{2.3} -# """] + self.head_prefix = [ + "\\section{\\module{%(module_name)s} --- %(module_summary)s}\n" + "\\declaremodule{%(module_type)s}{%(module_name)s}\n" + "\\moduleauthor{%(module_author)s}{%(module_author_email)s}\n" + "\\modulesynopsis{%(module_synopsis)s}\n" + "\\versionadded{%(version_added)s}\n" + % vars(self.__class__) + ] def astext(self): return ''.join(self.head_prefix + @@ -132,6 +143,12 @@ self.body_suffix) + def mangle_title(self, title): + """Chop up a title for use in a section label or reference.""" + words = [word.lower() for word in title.split()] + return "%s-%s" % (self.module_name, "-".join(words)) + + def visit_document(self, node): pass @@ -139,17 +156,16 @@ pass def visit_docinfo(self, node): - print "visit_docinfo: %r" % node - self.docinfo = ["% start docinfo\n"] + #print "visit_docinfo: %r" % node + self.docinfo = [] def depart_docinfo(self, node): - print "depart_docinfo: %r" % node - self.docinfo.append("% end docinfo\n") + #print "depart_docinfo: %r" % node self.body = self.docinfo + self.body self.docinfo = None def visit_docinfo_item(self, node, name): - print "visit_docinfo_item: node=%r, name=%r" % (node, name) + #print "visit_docinfo_item: node=%r, name=%r" % (node, name) if name == "author": (name, email) = rfc822.parseaddr(node.astext()) self.docinfo.append("\\sectionauthor{%s}{%s}\n" % (name, email)) @@ -158,13 +174,13 @@ def depart_docinfo_item(self, node): pass - def visit_field(self, node): - (name, value) = (node[0].astext(), node[1].astext()) - print "visit_field: node=%r (name=%r, value=%r)" % (node, name, value) - if self.docinfo is not None: - if name == "VersionAdded": - self.docinfo.append("\\versionadded{%s}\n" % value) - raise nodes.SkipNode + #def visit_field(self, node): + # (name, value) = (node[0].astext(), node[1].astext()) + # print "visit_field: node=%r (name=%r, value=%r)" % (node, name, value) + # if self.docinfo is not None: + # if name == "VersionAdded": + # self.docinfo.append("\\versionadded{%s}\n" % value) + # raise nodes.SkipNode _quoted_string_re = re.compile(r'\"[^\"]*\"') _short_opt_string_re = re.compile(r'-[a-zA-Z]') @@ -176,7 +192,9 @@ def visit_literal(self, node): assert isinstance(node[0], nodes.Text) text = node[0].astext() - if self._quoted_string_re.match(text): + if self.in_title: + cmd = None + elif self._quoted_string_re.match(text): cmd = 'code' elif self._short_opt_string_re.match(text): cmd = 'programopt' @@ -187,16 +205,18 @@ elif self._identifier_re.match(text): cmd = self.codemarkup.get(text) if cmd is None: - print "warning: unrecognized code word %r" % text + #print "warning: unrecognized code word %r" % text cmd = 'code' else: cmd = 'code' - self.verbatim = 1 - self.body.append('\\%s{' % cmd) + self.literal = 1 + if cmd is not None: + self.body.append('\\%s{' % cmd) def depart_literal(self, node): - self.body.append('}') + if not self.in_title: + self.body.append('}') self.verbatim = 0 def visit_literal_block(self, node): @@ -208,17 +228,61 @@ self.body.append("\n\\end{verbatim}\n") def visit_title(self, node): + label = self.mangle_title(node.astext()) section_name = self.d_class.section(self.section_level) self.body.append("\n\n\\%s{" % section_name) - self.context.append("}\n") + self.context.append("\\label{%s}}\n" % label) + self.in_title = True def depart_title(self, node): + self.in_title = False self.body.append(self.context.pop()) + + def visit_target(self, node): + pass + + def depart_target(self, node): + pass def bookmark(self, node): pass + def visit_definition(self, node): + pass + + def depart_definition(self, node): + pass + def visit_definition_list_item(self, node): + pass + + def depart_definition_list_item(self, node): + pass + + def visit_reference(self, node): + if node.has_key('refuri'): + label = self.refuri_override.get(node['refuri']) + print "got refuri=%r, label=%r" % (node['refuri'], label) + elif node.has_key('refid'): + label = self.mangle_title(node['refid']) + print "got refid=%r, label=%r" % (node['refid'], label) + else: + print "warning: unhandled reference: node=%r" % node + LaTeXTranslator.visit_reference(self, node) + + self.body.append("section~\\ref{%s}, " % label) + raise nodes.SkipDeparture + + _em_dash_re = re.compile(r'\b\s*\-\-\-?\s*\b') + + def visit_Text(self, node): + text = node.astext() + text = self._em_dash_re.sub("---", text) # does this belong in encode()? + self.body.append(self.encode(text)) + + def depart_Text(self, node): + pass + def concatenate_sources(sources, target): |
|
From: Greg W. <gw...@us...> - 2004-08-23 02:01:56
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21900 Added Files: mkpydoc Log Message: Script to convert Optik docs to LaTeX format for the Python library, mainly by overriding many bits of docutils.writers.latex2e.LaTeXTranslator. --- NEW FILE: mkpydoc --- #!/usr/bin/python # Convert the Optik docs to LaTeX for use in Python docs import sys, os import re from popen2 import popen2 from glob import glob import rfc822 from distutils.dep_util import newer_group, newer from docutils.core import Publisher from docutils.writers.latex2e import Writer as LaTeXWriter, LaTeXTranslator from docutils import nodes class PyLaTeXWriter(LaTeXWriter): def translate(self): # ugh, copy-n-pasted from docutils.writers.latex2e.Writer.translate() visitor = PyLaTeXTranslator(self.document) self.document.walkabout(visitor) self.output = visitor.astext() self.head_prefix = visitor.head_prefix self.head = visitor.head self.body_prefix = visitor.body_prefix self.body = visitor.body self.body_suffix = visitor.body_suffix class PyLaTeXTranslator(LaTeXTranslator): codemarkup = { # Methods of OptionParser, Option, Values, ... 'add_option()' : 'method', 'set_defaults()' : 'method', 'parse_args()' : 'method', 'OptionParser.parse_args()' : 'method', 'parser.print_help()' : 'method', 'error()' : 'method', 'take_action()' : 'method', 'Option.take_action()' : 'method', 'MyOption.take_action()': 'method', 'ensure_value()' : 'method', '_process_long_opt()' : 'method', '_process_short_opts()' : 'method', # Optik/optparse classes 'OptionParser' : 'class', 'Option' : 'class', 'make_option()' : 'function', # Class attributes of Option 'ACTIONS' : 'member', 'STORE_ACTIONS' : 'member', 'TYPED_ACTIONS' : 'member', 'TYPES' : 'member', 'TYPE_CHECKER' : 'member', 'Option.TYPE_CHECKER' : 'member', # Miscellaneous builtins / other standard stuff 'sys.exit()' : 'function', 'sys.argv' : 'var', 'str()' : 'function', 'getattr()' : 'function', 'copy()' : 'function', 'None' : 'code', 'True' : 'code', 'False' : 'code', # Hmmm, these sorta depend on context (but they're pretty # consistently the main Option attributes). 'action' : 'member', 'type' : 'member', 'dest' : 'member', 'help' : 'member', # Various values for Option.action: what is the right markup? 'store' : 'code', 'store_true' : 'code', 'store_false' : 'code', 'store_const' : 'code', 'append' : 'code', 'extend' : 'code', 'count' : 'code', 'callback' : 'code', # These are even more context-dependent. 'usage' : 'var', 'version' : 'var', 'args' : 'var', 'verbose' : 'var', 'options' : 'var', 'options.file' : 'var', 'options.filename' : 'var', 'filename' : 'var', } def __init__(self, document): LaTeXTranslator.__init__(self, document) self.head_prefix = [] self.head = [] self.body_prefix = [] # Disable a bunch of methods from the base class. empty_method = lambda self: None for nodetype in ('field_argument', 'field_body', 'field_list', 'field_name'): setattr(self, 'visit_' + nodetype, empty_method) setattr(self, 'depart_' + nodetype, empty_method) # self.head_prefix = ["""\ # \\section{\\module{optparse} --- Powerful command line option parser.} # \\declaremodule{standard}{optparse} # \\moduleauthor{Greg Ward}{gw...@py...} # \\sectionauthor{Greg Ward}{gw...@py...} # \\modulesynopsis{Powerful, flexible, extensible, easy-to-use command-line # parsing library.} # \\versionadded{2.3} # """] def astext(self): return ''.join(self.head_prefix + self.head + self.body_prefix + self.body + self.body_suffix) def visit_document(self, node): pass def depart_document(self, node): pass def visit_docinfo(self, node): print "visit_docinfo: %r" % node self.docinfo = ["% start docinfo\n"] def depart_docinfo(self, node): print "depart_docinfo: %r" % node self.docinfo.append("% end docinfo\n") self.body = self.docinfo + self.body self.docinfo = None def visit_docinfo_item(self, node, name): print "visit_docinfo_item: node=%r, name=%r" % (node, name) if name == "author": (name, email) = rfc822.parseaddr(node.astext()) self.docinfo.append("\\sectionauthor{%s}{%s}\n" % (name, email)) raise nodes.SkipNode def depart_docinfo_item(self, node): pass def visit_field(self, node): (name, value) = (node[0].astext(), node[1].astext()) print "visit_field: node=%r (name=%r, value=%r)" % (node, name, value) if self.docinfo is not None: if name == "VersionAdded": self.docinfo.append("\\versionadded{%s}\n" % value) raise nodes.SkipNode _quoted_string_re = re.compile(r'\"[^\"]*\"') _short_opt_string_re = re.compile(r'-[a-zA-Z]') _long_opt_string_re = re.compile(r'--[a-zA-Z-]+') _identifier_re = re.compile(r'[a-zA-Z_][a-zA-Z_0-9]*' r'(\.[a-zA-Z_][a-zA-Z_0-9]*)*' r'(\(\))?$') def visit_literal(self, node): assert isinstance(node[0], nodes.Text) text = node[0].astext() if self._quoted_string_re.match(text): cmd = 'code' elif self._short_opt_string_re.match(text): cmd = 'programopt' text = text[1] elif self._long_opt_string_re.match(text): cmd = 'longprogramopt' text = text[2:] elif self._identifier_re.match(text): cmd = self.codemarkup.get(text) if cmd is None: print "warning: unrecognized code word %r" % text cmd = 'code' else: cmd = 'code' self.verbatim = 1 self.body.append('\\%s{' % cmd) def depart_literal(self, node): self.body.append('}') self.verbatim = 0 def visit_literal_block(self, node): self.body.append("\\begin{verbatim}\n") self.verbatim = 1 def depart_literal_block(self, node): self.verbatim = 0 self.body.append("\n\\end{verbatim}\n") def visit_title(self, node): section_name = self.d_class.section(self.section_level) self.body.append("\n\n\\%s{" % section_name) self.context.append("}\n") def depart_title(self, node): self.body.append(self.context.pop()) def bookmark(self, node): pass def concatenate_sources(sources, target): print "concatenating source files to %s" % target outdir = os.path.dirname(target) if not os.path.isdir(outdir): os.makedirs(outdir) outfile = open(target, "wt") for filename in sources: file = open(filename, "rt") for line in file: outfile.write(line) outfile.write("\n\n") file.close() outfile.close() def convert(infilename, outfilename): print "converting %s to %s" % (infilename, outfilename) pub = Publisher() pub.set_components('standalone', # reader 'restructuredtext', # parser 'latex') # writer (arg, will be discarded) pub.writer = PyLaTeXWriter() pub.process_programmatic_settings(None, None, None) pub.set_source(source_path=infilename) pub.set_destination(destination_path=outfilename) pub.publish() def main(): sources = ["intro.txt", #"tao.txt", "basic.txt", #"advanced.txt", #"callbacks.txt", "extending.txt"] concat_sources = "tmp/optik.txt" if newer_group(sources, concat_sources): concatenate_sources(sources, concat_sources) outfilename = "tmp/optik.tex" if 1 or newer(concat_sources, outfilename): convert(concat_sources, outfilename) main() |
|
From: Greg W. <gw...@us...> - 2004-07-31 16:24:16
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15835 Modified Files: merge Log Message: Changes to convert Optik 1.5a1 to optparse.py for Python 2.4a2: * import gettext * define _repr() * update copyright dates * lose -c/--compatible option (Optik now requires Python 2.2) Add code to convert the test script -- just does s/optik/optparse/, but that's a help! Index: merge =================================================================== RCS file: /cvsroot/optik/optik/merge,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- merge 15 Sep 2003 13:40:07 -0000 1.10 +++ merge 31 Jul 2004 16:24:07 -0000 1.11 @@ -30,19 +30,16 @@ Return command-line options and output destination argument. The options returned are, of course, an optparse.Values instance. """ - usage = "usage: %prog [options] destination" + usage = "usage: %prog [options] module test" parser = OptionParser(usage=usage, description=__doc__) - parser.add_option("-c", "--compatible", action="store_true", default=0, - help="produce output compatible with Python 2.0") options, args = parser.parse_args() - if len(args) != 1: - parser.error("incorrect number of arguments (%s, should be 1)" - % len(args)) - return options, args[0] + if len(args) != 2: + parser.error("incorrect number of arguments") + return (options, args[0], args[1]) def main(): # Open the output file and write preamble. - options, outname = parse_args() + (options, outname, testname) = parse_args() outfile = open(outname, "w") username = pwd.getpwuid(os.getuid())[0] hostname = socket.getfqdn() @@ -84,8 +81,8 @@ print >>outfile, '''\ __copyright__ = """ -Copyright (c) 2001-2003 Gregory P. Ward. All rights reserved. -Copyright (c) 2002-2003 Python Software Foundation. All rights reserved. +Copyright (c) 2001-2004 Gregory P. Ward. All rights reserved. +Copyright (c) 2002-2004 Python Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -118,6 +115,11 @@ import sys, os import types import textwrap +from gettext import gettext as _ + +def _repr(self): + return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self) + ''' # We'll process the modules in this order -- option_parser comes @@ -126,8 +128,6 @@ ("help", "class HelpFormatter"), ("option", "_builtin_cvt"), ("option_parser", "SUPPRESS_HELP")] - if options.compatible: - modules[2] = ("option", "# Do the right thing with boolean values") contents = {} revision = {} @@ -183,4 +183,14 @@ make_option = Option""" outfile.close() + # Finally, convert the test script. (This doesn't do the whole thing + # -- still needs a bit of manual tweaking before it will work.) + file = open("test/test_optik.py") + outfile = open(testname, "wt") + for line in file: + line = line.replace("optik", "optparse") + outfile.write(line) + file.close() + outfile.close() + main() |
|
From: Greg W. <gw...@us...> - 2004-07-24 23:21:30
|
Update of /cvsroot/optik/optik/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10367 Modified Files: __init__.py errors.py help.py option.py option_parser.py Log Message: Update copyright dates. Rearrange module preambles so all files are the same: docstring, copyright comment, imports, __revision__, __all__. Index: errors.py =================================================================== RCS file: /cvsroot/optik/optik/lib/errors.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- errors.py 29 May 2004 02:32:09 -0000 1.8 +++ errors.py 24 Jul 2004 23:21:21 -0000 1.9 @@ -3,12 +3,10 @@ Exception classes used by Optik. """ -__revision__ = "$Id$" - -# Copyright (c) 2001-2003 Gregory P. Ward. All rights reserved. +# Copyright (c) 2001-2004 Gregory P. Ward. All rights reserved. # See the README.txt distributed with Optik for licensing terms. -# created 2001/10/17 GPW (from optik.py) +__revision__ = "$Id$" __all__ = ['OptikError', 'OptionError', 'OptionConflictError', 'OptionValueError', 'BadOptionError'] Index: option_parser.py =================================================================== RCS file: /cvsroot/optik/optik/lib/option_parser.py,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- option_parser.py 24 Jul 2004 21:27:28 -0000 1.66 +++ option_parser.py 24 Jul 2004 23:21:21 -0000 1.67 @@ -3,13 +3,9 @@ Provides the OptionParser and Values classes. """ -__revision__ = "$Id$" - -# Copyright (c) 2001-2003 Gregory P. Ward. All rights reserved. +# Copyright (c) 2001-2004 Gregory P. Ward. All rights reserved. # See the README.txt distributed with Optik for licensing terms. -# created 2001/10/17, GPW (from optik.py) - import sys, os import types from gettext import gettext as _ @@ -17,6 +13,8 @@ from optik.help import IndentedHelpFormatter from optik.errors import OptionConflictError, OptionValueError, BadOptionError +__revision__ = "$Id$" + __all__ = ['SUPPRESS_HELP', 'SUPPRESS_USAGE', 'Values', 'OptionContainer', 'OptionGroup', 'OptionParser'] Index: help.py =================================================================== RCS file: /cvsroot/optik/optik/lib/help.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- help.py 24 Jul 2004 21:02:35 -0000 1.14 +++ help.py 24 Jul 2004 23:21:21 -0000 1.15 @@ -1,13 +1,21 @@ -import textwrap +"""optik.help -__revision__ = "$Id$" +Provides HelpFormatter and subclasses -- used by OptionParser +to generate formatted help text. +""" -__all__ = ['HelpFormatter', 'IndentedHelpFormatter', 'TitledHelpFormatter'] +# Copyright (c) 2001-2004 Gregory P. Ward. All rights reserved. +# See the README.txt distributed with Optik for licensing terms. import os from gettext import gettext as _ +import textwrap from optik.option import NO_DEFAULT +__revision__ = "$Id$" + +__all__ = ['HelpFormatter', 'IndentedHelpFormatter', 'TitledHelpFormatter'] + class HelpFormatter: """ Index: __init__.py =================================================================== RCS file: /cvsroot/optik/optik/lib/__init__.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- __init__.py 24 Jul 2004 21:34:10 -0000 1.21 +++ __init__.py 24 Jul 2004 23:21:21 -0000 1.22 @@ -7,7 +7,7 @@ See http://optik.sourceforge.net/ """ -# Copyright (c) 2001-2003 Gregory P. Ward. All rights reserved. +# Copyright (c) 2001-2004 Gregory P. Ward. All rights reserved. # See the README.txt distributed with Optik for licensing terms. __revision__ = "$Id$" Index: option.py =================================================================== RCS file: /cvsroot/optik/optik/lib/option.py,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- option.py 24 Jul 2004 20:41:46 -0000 1.32 +++ option.py 24 Jul 2004 23:21:21 -0000 1.33 @@ -3,18 +3,16 @@ Defines the Option class and some standard value-checking functions. """ -__revision__ = "$Id$" - -# Copyright (c) 2001-2003 Gregory P. Ward. All rights reserved. +# Copyright (c) 2001-2004 Gregory P. Ward. All rights reserved. # See the README.txt distributed with Optik for licensing terms. -# created 2001/10/17, GPW (from optik.py) - import sys import types from gettext import gettext as _ from optik.errors import OptionError, OptionValueError +__revision__ = "$Id$" + __all__ = ['Option'] # Do the right thing with boolean values for all known Python versions. |
|
From: Greg W. <gw...@us...> - 2004-07-24 22:02:59
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32700 Modified Files: README.txt Log Message: Docs are now included in HTML format. Index: README.txt =================================================================== RCS file: /cvsroot/optik/optik/README.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- README.txt 24 Jul 2004 21:33:36 -0000 1.16 +++ README.txt 24 Jul 2004 22:02:50 -0000 1.17 @@ -85,20 +85,20 @@ Optik comes with several documents: - * tao.txt philosophy and background; if you're not sure what the - difference between an argument and an option is, read this + * tao.html philosophy and background; if you're not sure what the + difference between an argument and an option is, read this - * basic.txt basic information on using Optik in your programs + * basic.html basic information on using Optik in your programs - * advanced.txt a detailed reference guide to all of Optik's features + * advanced.html a detailed reference guide to all of Optik's features - * callbacks.txt how to define callback options and write the callback - functions that go with them + * callbacks.html how to define callback options and write the callback + functions that go with them - * extending.txt information on extending Optik (eg. how to add new - actions and types) + * extending.html information on extending Optik (eg. how to add new + actions and types) -You can also find these documents in HTML form online: +You can also find these documents online: http://www.gerg.ca/software/optik/ http://optik.sourceforge.net/ |
|
From: Greg W. <gw...@us...> - 2004-07-24 22:02:23
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32535 Modified Files: MANIFEST.in Log Message: Don't include random *.py files in top dir. Include HTML docs. Include I18N stuff in po/ dir. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/optik/optik/MANIFEST.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MANIFEST.in 11 Apr 2002 19:27:34 -0000 1.4 +++ MANIFEST.in 24 Jul 2004 22:02:13 -0000 1.5 @@ -1,4 +1,7 @@ -include *.txt -include test/test*.py test/runall +include *.txt *.html +include optparse.py +exclude ./*.py +include test/test*.py include examples/*.py exclude examples/optional_arg*.py +include po/*.pot po/*.po |
|
From: Greg W. <gw...@us...> - 2004-07-24 22:01:28
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32428 Modified Files: CHANGES.txt Log Message: More details on I18N patch: list translations and give credit to translators. Index: CHANGES.txt =================================================================== RCS file: /cvsroot/optik/optik/CHANGES.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- CHANGES.txt 24 Jul 2004 21:56:15 -0000 1.18 +++ CHANGES.txt 24 Jul 2004 22:01:18 -0000 1.19 @@ -203,10 +203,12 @@ HelpFormatter to allow (slight) customization of the formatting. * SF patch #736940: internationalize Optik: all built-in user- - targeted literal strings are passed through gettext.gettext(). - Also added po/ directory for message catalog and translations, - so that Optik-based applications have a single place to go for - translations of Optik's built-in messags. + targeted literal strings are passed through gettext.gettext(). Also + added po/ directory for message catalog and translations, so that + Optik-based applications have a single place to go for translations + of Optik's built-in messags. Include translations for Danish and + German (thanks to Frederik S. Olesen and Martin v. Löwis + respectively), and partial translations for French (by me). * SF bug #878453 (Python): respect $COLUMNS environment variable for wrapping help output. |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:56:24
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31720 Modified Files: CHANGES.txt Log Message: Mention changes to what's included in the source dist. Index: CHANGES.txt =================================================================== RCS file: /cvsroot/optik/optik/CHANGES.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- CHANGES.txt 24 Jul 2004 21:13:35 -0000 1.17 +++ CHANGES.txt 24 Jul 2004 21:56:15 -0000 1.18 @@ -217,3 +217,9 @@ * SF feature #988122: expand "%prog" in the 'description' passed to OptionParser, just like in the 'usage' and 'version' strings. (This is *not* done in the 'description' passed to OptionGroup.) + + * Added HTML-formatted docs to the source distribution (in addition + to the reStructuredText source files). + + * Added three new examples: custom_source.py, custom_type.py, and + no_help.py. |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:50:12
|
Update of /cvsroot/optik/optik/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31120 Modified Files: no_help.py Log Message: No need to subclass OptionParser to suppress --help option -- just pass add_help_option=False to constructor. Index: no_help.py =================================================================== RCS file: /cvsroot/optik/optik/examples/no_help.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- no_help.py 6 May 2004 01:35:25 -0000 1.1 +++ no_help.py 24 Jul 2004 21:50:04 -0000 1.2 @@ -5,12 +5,8 @@ from optik import OptionParser -class UnfriendlyOptionParser(OptionParser): - def _add_help_option(self): - pass - def main(): - parser = UnfriendlyOptionParser("%prog [options] arg") + parser = OptionParser("%prog [options] arg", add_help_option=False) parser.add_option("-f", "--foo", help="specify the foo object") parser.add_option("-x", "--exclude", help="exclude stuff") (options, args) = parser.parse_args() |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:47:47
|
Update of /cvsroot/optik/optik/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30881 Modified Files: custom_type.py Log Message: Note that the problem illustrated here no longer exists, and use a sensible default value ("5m") to prove the point. Fix _check_duration() so it handles bad input correctly. Index: custom_type.py =================================================================== RCS file: /cvsroot/optik/optik/examples/custom_type.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- custom_type.py 29 May 2004 02:06:42 -0000 1.1 +++ custom_type.py 24 Jul 2004 21:47:38 -0000 1.2 @@ -3,10 +3,11 @@ # Example code that illustrates the problem described in # bug #955889 -- see # https://sourceforge.net/tracker/index.php?func=detail&aid=955889&group_id=38019&atid=421097 -# for details. +# for details. (This problem has been fixed, so this code shows +# the right way [as of Optik 1.5] to do things.) from copy import copy -from optik import OptionParser, Option +from optik import OptionParser, Option, OptionValueError _time_units = { 's' : 1, 'm' : 60, 'h' : 60*60, 'd' : 60*60*24 } @@ -19,7 +20,7 @@ def _check_duration(option, opt, value): try: return _get_duration(value) - except ValueError, IndexError: + except (ValueError, IndexError, KeyError): raise OptionValueError( 'option %s: invalid duration: %r' % (opt, value)) @@ -35,9 +36,7 @@ self.add_option( '--delay', type='duration', - # oops, default doesn't run through type checker - #default='5m', - default=300, + default='5m', # this did not work prior to Optik 1.5 help='self destruct delay [default: %default]') parser = MyOptionParser() |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:34:19
|
Update of /cvsroot/optik/optik/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29487/lib Modified Files: __init__.py Log Message: Bump version to 1.5a1. Index: __init__.py =================================================================== RCS file: /cvsroot/optik/optik/lib/__init__.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- __init__.py 8 May 2003 01:21:10 -0000 1.20 +++ __init__.py 24 Jul 2004 21:34:10 -0000 1.21 @@ -12,7 +12,7 @@ __revision__ = "$Id$" -__version__ = "1.4.1+" +__version__ = "1.5a1" # Re-import these for convenience |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:34:19
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29487 Modified Files: setup.py Log Message: Bump version to 1.5a1. Index: setup.py =================================================================== RCS file: /cvsroot/optik/optik/setup.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- setup.py 21 Jun 2003 01:48:24 -0000 1.18 +++ setup.py 24 Jul 2004 21:34:10 -0000 1.19 @@ -8,7 +8,7 @@ "(use optparse instead)\n") setup(name = "Optik", - version = "1.4.1+", + version = "1.5a1", author = "Greg Ward", author_email = "gw...@py...", url = "http://optik.sourceforge.net/", |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:33:45
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29384 Modified Files: README.txt Log Message: Oops, fix typo. Index: README.txt =================================================================== RCS file: /cvsroot/optik/optik/README.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- README.txt 24 Jul 2004 21:32:42 -0000 1.15 +++ README.txt 24 Jul 2004 21:33:36 -0000 1.16 @@ -63,7 +63,7 @@ python setup.py install As of Python 2.3, Optik is included in the Python standard library as -'optparse'. Python 2.3 included Optik 1.4.2 plus a few small bug fixes. +'optparse'. Python 2.3 included Optik 1.4.1 plus a few small bug fixes. If you want to use the new features in Optik 1.5 (see CHANGES.txt), you'll need to "import optik" in your source code. Otherwise, you can "import optparse", and your code will work with Python 2.3 and up |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:32:51
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29215 Modified Files: README.txt Log Message: Updates for Optik 1.5. Index: README.txt =================================================================== RCS file: /cvsroot/optik/optik/README.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- README.txt 29 May 2004 01:58:44 -0000 1.14 +++ README.txt 24 Jul 2004 21:32:42 -0000 1.15 @@ -1,5 +1,5 @@ -Optik 1.4.1 -=========== +Optik 1.5 +========= Optik is a powerful, flexible, extensible, easy-to-use command-line parsing library for Python. Using Optik, you can add intelligent, @@ -15,7 +15,7 @@ parser.add_option("-f", "--file", dest="filename", help="write report to FILE", metavar="FILE") parser.add_option("-q", "--quiet", - action="store_false", dest="verbose", default=1, + action="store_false", dest="verbose", default=True, help="don't print status messages to stdout") (options, args) = parser.parse_args() @@ -28,14 +28,16 @@ <yourscript> --file=outfile -q <yourscript> --quiet --file outfile -(All of these result in +all of which result in the 'options' object looking like this: + options.filename == "outfile" options.verbose == 0 -...just as you might expect.) Even niftier, users can run one of + <yourscript> -h <yourscript> --help + and Optik will print out a brief summary of your script's options: usage: <yourscript> [options] @@ -53,14 +55,20 @@ REQUIREMENTS & INSTALLATION --------------------------- -Optik requires Python 2.0 or greater (although this release has only -been tested with Python 2.1, 2.2, and 2.3.) +Optik requires Python 2.2 or greater. Installing Optik is easy; just use the standard incantion for installing Python modules: python setup.py install +As of Python 2.3, Optik is included in the Python standard library as +'optparse'. Python 2.3 included Optik 1.4.2 plus a few small bug fixes. +If you want to use the new features in Optik 1.5 (see CHANGES.txt), +you'll need to "import optik" in your source code. Otherwise, you can +"import optparse", and your code will work with Python 2.3 and up +without additional requirements. + TESTING ------- @@ -90,6 +98,11 @@ * extending.txt information on extending Optik (eg. how to add new actions and types) +You can also find these documents in HTML form online: + + http://www.gerg.ca/software/optik/ + http://optik.sourceforge.net/ + Additionally, the examples/ subdirectory demonstrates various ways to extend Optik. @@ -130,7 +143,7 @@ Terrel Shumway Johannes Gijsbers -Copyright (c) 2001-2003 Gregory P. Ward. All rights reserved. +Copyright (c) 2001-2004 Gregory P. Ward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:27:36
|
Update of /cvsroot/optik/optik/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28571 Modified Files: option_parser.py Log Message: Add Values.__ne__() so the tests pass under Python 2.2. Index: option_parser.py =================================================================== RCS file: /cvsroot/optik/optik/lib/option_parser.py,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- option_parser.py 24 Jul 2004 21:03:56 -0000 1.65 +++ option_parser.py 24 Jul 2004 21:27:28 -0000 1.66 @@ -54,6 +54,9 @@ else: return false + def __ne__(self, other): + return not (self == other) + def _update_careful(self, dict): """ Update the option values from an arbitrary dictionary, but only |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:13:44
|
Update of /cvsroot/optik/optik In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26502 Modified Files: CHANGES.txt Log Message: Document various recent changes: SF #815264, #878453, #964317, and #988122. Index: CHANGES.txt =================================================================== RCS file: /cvsroot/optik/optik/CHANGES.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- CHANGES.txt 6 Jun 2004 21:58:36 -0000 1.16 +++ CHANGES.txt 24 Jul 2004 21:13:35 -0000 1.17 @@ -197,8 +197,23 @@ * SF bug #960515: don't crash when generating help for callback options that specify 'type', but not 'dest' or 'metavar'. + * SF feature #815264: change the default help format for short options + that take an argument from e.g. "-oARG" to "-o ARG"; add + set_short_opt_delimiter() and set_long_opt_delimiter() methods to + HelpFormatter to allow (slight) customization of the formatting. + * SF patch #736940: internationalize Optik: all built-in user- targeted literal strings are passed through gettext.gettext(). Also added po/ directory for message catalog and translations, so that Optik-based applications have a single place to go for translations of Optik's built-in messags. + + * SF bug #878453 (Python): respect $COLUMNS environment variable for + wrapping help output. + + * SF feature #964317: allow type objects to specify option types; + allow "str" as an alias for "string". + + * SF feature #988122: expand "%prog" in the 'description' passed + to OptionParser, just like in the 'usage' and 'version' strings. + (This is *not* done in the 'description' passed to OptionGroup.) |
|
From: Greg W. <gw...@us...> - 2004-07-24 21:05:39
|
Update of /cvsroot/optik/optik/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25255 Modified Files: test_optik.py Log Message: SF #988122: modify TestHelp.test_help_description_groups() to test that "%prog" is expanded in the program description. Index: test_optik.py =================================================================== RCS file: /cvsroot/optik/optik/test/test_optik.py,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- test_optik.py 24 Jul 2004 20:43:13 -0000 1.30 +++ test_optik.py 24 Jul 2004 21:05:30 -0000 1.31 @@ -1414,7 +1414,7 @@ def test_help_description_groups(self): self.parser.set_description( - "This is the program description. This program has " + "This is the program description for %prog. %prog has " "an option group as well as single options.") group = OptionGroup( @@ -1427,8 +1427,8 @@ self.assertHelpEquals("""\ usage: bar.py [options] -This is the program description. This program has an option group as well as -single options. +This is the program description for bar.py. bar.py has an option group as +well as single options. options: -a APPLE throw APPLEs at basket |