summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-09-25 01:58:31 (GMT)
committerGreg Ward <gward@python.net>2000-09-25 01:58:31 (GMT)
commit68ded6e6f148ef0dc95418be7a9bb61385942362 (patch)
tree3319d647892304b2b42f0c6f8cdb72de51360676 /Lib
parent2f2b6c62baf42e06c06f0dcae4879cf88dd6a916 (diff)
downloadcpython-68ded6e6f148ef0dc95418be7a9bb61385942362.zip
cpython-68ded6e6f148ef0dc95418be7a9bb61385942362.tar.gz
cpython-68ded6e6f148ef0dc95418be7a9bb61385942362.tar.bz2
Added 'translate_longopt()' function.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/fancy_getopt.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/distutils/fancy_getopt.py b/Lib/distutils/fancy_getopt.py
index eaf6073..f935200 100644
--- a/Lib/distutils/fancy_getopt.py
+++ b/Lib/distutils/fancy_getopt.py
@@ -470,6 +470,13 @@ def wrap_text (text, width):
return lines
# wrap_text ()
+
+
+def translate_longopt (opt):
+ """Convert a long option name to a valid Python identifier by
+ changing "-" to "_".
+ """
+ return string.translate(opt, longopt_xlate)
class OptionDummy: