[Apt-offline-devel] [SCM] Offline APT Package Manager branch, master, updated. 0.9.7-2-gfeddb89
Ritesh Raj Sarraf
rrs at researchut.com
Tue Mar 23 10:23:08 UTC 2010
The following commit has been merged in the master branch:
commit feddb890bf4838bbbed7c8d5cc50d8361c24925f
Author: Ritesh Raj Sarraf <rrs at researchut.com>
Date: Tue Mar 23 15:52:53 2010 +0530
backward compatibility with older argparse
diff --git a/apt_offline_core/AptOfflineCoreLib.py b/apt_offline_core/AptOfflineCoreLib.py
index b790704..75409c0 100644
--- a/apt_offline_core/AptOfflineCoreLib.py
+++ b/apt_offline_core/AptOfflineCoreLib.py
@@ -1614,9 +1614,15 @@ def main():
global_options.add_argument("--simulate", dest="simulate", help="Just simulate. Very helpful when debugging",
action="store_true" )
- parser = argparse.ArgumentParser( prog=app_name, description="Offline APT Package Manager" + ' - ' + version,
+ if argparse.__version__ >= 1.1:
+ parser = argparse.ArgumentParser( prog=app_name, description="Offline APT Package Manager" + ' - ' + version,
epilog=copyright + " - " + terminal_license, parents=[global_options])
- parser.add_argument("-v", "--version", action='version', version=version)
+ parser.add_argument("-v", "--version", action='version', version=version)
+ else:
+ # Remain backward compatible with older argparse versions
+ parser = argparse.ArgumentParser( prog=app_name, version=app_name + " - " + version,
+ description="Offline APT Package Manager", epilog=copyright + " - " + terminal_license,
+ parents=[global_options])
# We need subparsers for set/get/install
subparsers = parser.add_subparsers()
--
Offline APT Package Manager
More information about the Apt-offline-devel
mailing list