From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-catalyst+bounces-2615-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 99E12198005
	for <garchives@archives.gentoo.org>; Thu, 28 Feb 2013 01:48:09 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 909BEE079D;
	Thu, 28 Feb 2013 01:48:00 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 0969FE079D
	for <gentoo-catalyst@lists.gentoo.org>; Thu, 28 Feb 2013 01:47:59 +0000 (UTC)
Received: from big_daddy.dol-sen.ca (unknown [24.86.176.233])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: dolsen)
	by smtp.gentoo.org (Postfix) with ESMTPSA id E51AB33DFAA;
	Thu, 28 Feb 2013 01:47:58 +0000 (UTC)
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: Brian Dolbec <dolsen@gentoo.org>
Subject: [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve useage() output formatting slightly
Date: Wed, 27 Feb 2013 17:47:01 -0800
Message-Id: <1362016021-8338-5-git-send-email-dolsen@gentoo.org>
X-Mailer: git-send-email 1.8.1.4
In-Reply-To: <1362016021-8338-1-git-send-email-dolsen@gentoo.org>
References: <1362016021-8338-1-git-send-email-dolsen@gentoo.org>
Precedence: bulk
List-Post: <mailto:gentoo-catalyst@lists.gentoo.org>
List-Help: <mailto:gentoo-catalyst+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-catalyst+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-catalyst+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-catalyst.gentoo.org>
X-BeenThere: gentoo-catalyst@lists.gentoo.org
Reply-to: gentoo-catalyst@lists.gentoo.org
X-Archives-Salt: abff769b-e701-435b-ad52-4b18f25c969a
X-Archives-Hash: b528ea6c711c5b293cea1d595b4d2805

Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 catalyst | 81 +++++++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 47 insertions(+), 34 deletions(-)

diff --git a/catalyst b/catalyst
index 0878ce4..2a9b75c 100755
--- a/catalyst
+++ b/catalyst
@@ -24,31 +24,33 @@ __version__="2.0.12.2"
 conf_values={}
 
 def usage():
-	print "Usage catalyst [options] [-C variable=value...] [ -s identifier]"
-	print " -a --clear-autoresume	clear autoresume flags"
-	print " -c --config     use specified configuration file"
-	print " -C --cli        catalyst commandline (MUST BE LAST OPTION)"
-	print " -d --debug      enable debugging"
-	print " -f --file       read specfile"
-	print " -F --fetchonly  fetch files only"
-	print " -h --help       print this help message"
-	print " -p --purge      clear tmp dirs,package cache and autoresume flags"
-	print " -P --purgeonly  clear tmp dirs,package cache and autoresume flags and exit"
-	print " -T --purgetmponly  clear tmp dirs and autoresume flags and exit"
-	print " -s --snapshot   generate a release snapshot"
-	print " -V --version    display version information"
-	print " -v --verbose    verbose output"
-	print
-	print "Usage examples:"
-	print
-	print "Using the commandline option (-C, --cli) to build a Portage snapshot:"
-	print "catalyst -C target=snapshot version_stamp=my_date"
-	print
-	print "Using the snapshot option (-s, --snapshot) to build a release snapshot:"
-	print "catalyst -s 20071121"
-	print
-	print "Using the specfile option (-f, --file) to build a stage target:"
-	print "catalyst -f stage1-specfile.spec"
+	print """Usage catalyst [options] [-C variable=value...] [ -s identifier]
+ -a --clear-autoresume  clear autoresume flags
+ -c --config            use specified configuration file
+ -C --cli               catalyst commandline (MUST BE LAST OPTION)
+ -d --debug             enable debugging
+ -f --file              read specfile
+ -F --fetchonly         fetch files only
+ -h --help              print this help message
+ -p --purge             clear tmp dirs,package cache, autoresume flags
+ -P --purgeonly         clear tmp dirs,package cache, autoresume flags and exit
+ -T --purgetmponly      clear tmp dirs and autoresume flags and exit
+ -s --snapshot          generate a release snapshot
+ -V --version           display version information
+ -v --verbose           verbose output
+
+Usage examples:
+
+Using the commandline option (-C, --cli) to build a Portage snapshot:
+catalyst -C target=snapshot version_stamp=my_date
+
+Using the snapshot option (-s, --snapshot) to build a release snapshot:
+catalyst -s 20071121"
+
+Using the specfile option (-f, --file) to build a stage target:
+catalyst -f stage1-specfile.spec
+"""
+
 
 def version():
 	print "Catalyst, version "+__version__
@@ -78,7 +80,8 @@ def parse_config(myconfig):
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
 		if os.path.exists(myconfig):
-			print "Using command line specified Catalyst configuration file, "+myconfig
+			print "Using command line specified Catalyst configuration file, "+\
+				myconfig
 			config_file=myconfig
 
 		else:
@@ -88,7 +91,8 @@ def parse_config(myconfig):
 
 	# next, try the default location
 	elif os.path.exists("/etc/catalyst/catalyst.conf"):
-		print "Using default Catalyst configuration file, /etc/catalyst/catalyst.conf"
+		print "Using default Catalyst configuration file," + \
+			" /etc/catalyst/catalyst.conf"
 		config_file="/etc/catalyst/catalyst.conf"
 
 	# can't find a config file (we are screwed), so bail out
@@ -188,14 +192,16 @@ def parse_config(myconfig):
 		conf_values["port_logdir"]=myconf["port_logdir"];
 
 def import_modules():
-	# import catalyst's own modules (i.e. catalyst_support and the arch modules)
+	# import catalyst's own modules
+	# (i.e. catalyst_support and the arch modules)
 	targetmap={}
 
 	try:
 		for x in required_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE))
+				module=imp.load_module(x,fh,"modules/"+x+".py",
+					(".py","r",imp.PY_SOURCE))
 				fh.close()
 
 			except IOError:
@@ -205,7 +211,8 @@ def import_modules():
 		for x in valid_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE))
+				module=imp.load_module(x,fh,"modules/"+x+".py",
+					(".py","r",imp.PY_SOURCE))
 				module.register(targetmap)
 				fh.close()
 
@@ -223,7 +230,8 @@ def import_modules():
 def build_target(addlargs, targetmap):
 	try:
 		if addlargs["target"] not in targetmap:
-			raise CatalystError,"Target \""+addlargs["target"]+"\" not available."
+			raise CatalystError, \
+				"Target \"%s\" not available." % addlargs["target"]
 
 		mytarget=targetmap[addlargs["target"]](conf_values, addlargs)
 
@@ -231,7 +239,8 @@ def build_target(addlargs, targetmap):
 
 	except:
 		catalyst.util.print_traceback()
-		print "!!! catalyst: Error encountered during run of target " + addlargs["target"]
+		print "!!! catalyst: Error encountered during run of target " + \
+			addlargs["target"]
 		sys.exit(1)
 
 if __name__ == "__main__":
@@ -250,8 +259,12 @@ if __name__ == "__main__":
 
 	# parse out the command line arguments
 	try:
-		opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", "version", "debug",\
-			"clear-autoresume", "config=", "cli=", "file=", "fetch", "verbose","snapshot="])
+		opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:",
+			["purge", "purgeonly", "purgetmponly", "help", "version", "debug",
+			"clear-autoresume", "config=", "cli=", "file=", "fetch",
+			"verbose","snapshot="
+			]
+		)
 
 	except getopt.GetoptError:
 		usage()
-- 
1.8.1.4