From 0510a9773d213732892dd6a0a8644a252d95f4b5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 15 Sep 2009 09:32:40 -0400 Subject: Added libbe.version, wrapping the auto-generated libbe._version. Two major benefits: 1) Programatic access to the BE version. Previously the version-string logic was internal to the commandline interface ./be, which left the other interfaces hanging. 2) Simple to override auto-generated revision id version with any string you like (by setting libbe.version._VERSION, if that's the way you want to run things or the way your packaging system requires. Note that other modules should never read libbe.version._VERSION, since it may not be defined. Instead they should use the output of libbe.version.version(). --- be | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'be') diff --git a/be b/be index 36deaba..1f7e4a3 100755 --- a/be +++ b/be @@ -21,7 +21,7 @@ import os import sys -from libbe import cmdutil, _version +from libbe import cmdutil, version __doc__ = cmdutil.help() @@ -51,7 +51,7 @@ except cmdutil.GetCompletions, e: sys.exit(0) if options.version == True: - print _version.version_info["revision_id"] + print version.version() sys.exit(0) if options.dir != None: os.chdir(options.dir) -- cgit