From b0ef6a905b26ef0ff1beefb05b7a3f43f7642f0f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 30 Dec 2008 09:53:30 -0600 Subject: [PATCH] Centralized version number in setup.py --- in/man=wicd-manager-settings.conf.5.in | 2 +- in/man=wicd-wired-settings.conf.5.in | 2 +- in/man=wicd-wireless-settings.conf.5.in | 2 +- in/man=wicd.8.in | 2 +- in/wicd=wpath.py.in | 2 ++ setup.py | 2 ++ wicd/wicd-client.py | 4 ++-- wicd/wicd-daemon.py | 7 +++---- wicd/wpath.py | 2 ++ 9 files changed, 15 insertions(+), 10 deletions(-) diff --git a/in/man=wicd-manager-settings.conf.5.in b/in/man=wicd-manager-settings.conf.5.in index a27b724..847e2f1 100644 --- a/in/man=wicd-manager-settings.conf.5.in +++ b/in/man=wicd-manager-settings.conf.5.in @@ -1,5 +1,5 @@ .\" Written by Robby Workman -.TH WICD-MANAGER-SETTINGS.CONF 5 "June 2008" "wicd-1.5.0" +.TH WICD-MANAGER-SETTINGS.CONF 5 "June 2008" "wicd-%VERSION%" .SH NAME wicd-manager-settings.conf \- contains settings that control Wicd's behavior diff --git a/in/man=wicd-wired-settings.conf.5.in b/in/man=wicd-wired-settings.conf.5.in index 74f30f3..55a66cf 100644 --- a/in/man=wicd-wired-settings.conf.5.in +++ b/in/man=wicd-wired-settings.conf.5.in @@ -1,5 +1,5 @@ .\" Written by Robby Workman -.TH WICD-WIRED-SETTINGS.CONF 5 "June 2008" "wicd-1.5.0" +.TH WICD-WIRED-SETTINGS.CONF 5 "June 2008" "wicd-%VERSION%" .SH NAME wicd-wired-settings.conf \- controls Wicd's wired network settings diff --git a/in/man=wicd-wireless-settings.conf.5.in b/in/man=wicd-wireless-settings.conf.5.in index 5b08362..cf1afd3 100644 --- a/in/man=wicd-wireless-settings.conf.5.in +++ b/in/man=wicd-wireless-settings.conf.5.in @@ -1,5 +1,5 @@ .\" Written by Robby Workman -.TH WICD-WIRELESS-SETTINGS.CONF 5 "June 2008" "wicd-1.5.0" +.TH WICD-WIRELESS-SETTINGS.CONF 5 "June 2008" "wicd-%VERSION%" .SH NAME wicd-wired-settings.conf \- controls Wicd's wireless network settings diff --git a/in/man=wicd.8.in b/in/man=wicd.8.in index 4906024..9ca7591 100644 --- a/in/man=wicd.8.in +++ b/in/man=wicd.8.in @@ -1,5 +1,5 @@ .\" Written by Robby Workman -.TH WICD 8 "June 2008" "wicd-1.5.0" +.TH WICD 8 "June 2008" "wicd-%VERSION%" .SH NAME .B Wicd \- Wired and Wireless Network Connection Manager diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index 838a5c7..ccc122b 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -17,6 +17,8 @@ current = os.path.dirname(os.path.realpath(__file__)) + '/' # All directory paths *MUST* end in a / +version = '%VERSION%' + # DIRECTORIES lib = '%LIB%' diff --git a/setup.py b/setup.py index 16644e5..6e37f32 100755 --- a/setup.py +++ b/setup.py @@ -213,6 +213,8 @@ class configure(Command): for line in item_in.readlines(): for item, value in values: line = line.replace('%' + str(item.upper().replace('-','_')) + '%', str(value)) + + line = line.replace('%VERSION%', str(VERSION_NUM)) item_out.write(line) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index dab3f39..a74429a 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -632,14 +632,14 @@ class TrayIcon(object): def usage(): """ Print usage information. """ print """ -wicd 1.50 +wicd %s wireless (and wired) connection daemon front-end. Arguments: \t-n\t--no-tray\tRun wicd without the tray icon. \t-h\t--help\t\tPrint this help information. \t-a\t--no-animate\tRun the tray without network traffic tray animations. -""" +""" % wpath.version def setup_dbus(force=True): global bus, daemon, wireless, wired, DBUS_AVAIL diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 083884e..0a245e2 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -132,8 +132,7 @@ class WicdDaemon(dbus.service.Object): anything >= 0. This number is effective starting wicd v1.2.0. """ - version = '1.6.0' - return version + return wpath.version @dbus.service.method('org.wicd.daemon') def SetWiredInterface(self, interface): @@ -1447,7 +1446,7 @@ class WiredDaemon(dbus.service.Object): def usage(): print """ -wicd 1.6.0 +wicd %s wireless (and wired) connection daemon. Arguments: @@ -1457,7 +1456,7 @@ Arguments: \t-n\t--no-poll\tDon't monitor network status. \t-o\t--no-stdout\tDon't redirect stdout. \t-h\t--help\t\tPrint this help. -""" +""" % wpath.version def daemonize(): """ Disconnect from the controlling terminal. diff --git a/wicd/wpath.py b/wicd/wpath.py index 6afec6c..56cdcd9 100755 --- a/wicd/wpath.py +++ b/wicd/wpath.py @@ -17,6 +17,8 @@ current = os.path.dirname(os.path.realpath(__file__)) + '/' # All directory paths *MUST* end in a / +version = '1.6.0' + # DIRECTORIES lib = '/usr/lib/wicd/'