From 17acaed41ae6091a34ef1794dabb3b8f73927630 Mon Sep 17 00:00:00 2001 From: Fredrik Wahlberg Date: Wed, 28 Jan 2004 21:43:59 +0000 Subject: [PATCH] In getparams() we now check for optparse modules via optik as well. The optparse module is only available in Python 2.3, it is available as Optik in older versions. If missing the installer handles this. --- BUGS | 4 +++- dnsupdate.py | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/BUGS b/BUGS index c385fab..5a7c52e 100644 --- a/BUGS +++ b/BUGS @@ -1,6 +1,8 @@ Open bugs: -- optparse only included with python 2.3. Make sure installer detects. - Find out if a record is modifiable, otherwise return info. CNAME and A records. Fixed bugs +- optparse only included with python 2.3. Make sure installer detects. + Solution: + from optik import OptionParser diff --git a/dnsupdate.py b/dnsupdate.py index 00611cc..d122549 100644 --- a/dnsupdate.py +++ b/dnsupdate.py @@ -35,7 +35,12 @@ def get_ipaddress(): def getparams(msg): # Read command line parameters and input values - from optparse import OptionParser + # OptionParser is part of Python 2.3 and called optik if installed under + # Python 2.x + try: + from optparse import OptionParser + except: + from optik import OptionParser usage = "usage: %prog [OPTIONS]" parser = OptionParser(usage) parser.add_option("-c", "--config",