public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] [PATCH] lint: fix up unused variables
Date: Mon, 5 Oct 2015 23:36:58 -0700	[thread overview]
Message-ID: <20151005233658.37bb76f8.dolsen@gentoo.org> (raw)
In-Reply-To: <1444104393-16018-1-git-send-email-vapier@gentoo.org>

On Tue,  6 Oct 2015 00:06:33 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> This variables aren't actually used which the linter likes to warn
> about, so add a _ prefix to their name to silence the warnings.
> ---
>  catalyst/base/resume.py     | 2 +-
>  catalyst/main.py            | 2 +-
>  catalyst/support.py         | 2 +-
>  catalyst/targets/netboot.py | 5 +++--
>  setup.py                    | 2 +-
>  5 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py
> index 608f574..e3f03e7 100644
> --- a/catalyst/base/resume.py
> +++ b/catalyst/base/resume.py
> @@ -23,7 +23,7 @@ class AutoResumeError(Exception):
>  	def __init__(self, message, print_traceback=False):
>  		if message:
>  			if print_traceback:
> -				(type,value)=sys.exc_info()[:2]
> +				(_type, value) = sys.exc_info()[:2]
>  				if value!=None:
>  					print
>  					print "Traceback values
> found.  listing..." diff --git a/catalyst/main.py b/catalyst/main.py
> index dfa0609..04f689e 100644
> --- a/catalyst/main.py
> +++ b/catalyst/main.py
> @@ -182,7 +182,7 @@ def 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",\
> +		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:
> diff --git a/catalyst/support.py b/catalyst/support.py
> index 5563a15..a879eaf 100644
> --- a/catalyst/support.py
> +++ b/catalyst/support.py
> @@ -88,7 +88,7 @@ class CatalystError(Exception):
>  	def __init__(self, message, print_traceback=False):
>  		if message:
>  			if print_traceback:
> -				(type,value)=sys.exc_info()[:2]
> +				(_type, value) = sys.exc_info()[:2]
>  				if value!=None:
>  					print
>  					print "Traceback values
> found.  listing..." diff --git a/catalyst/targets/netboot.py
> b/catalyst/targets/netboot.py index c41ed59..b0e322c 100644
> --- a/catalyst/targets/netboot.py
> +++ b/catalyst/targets/netboot.py
> @@ -31,11 +31,12 @@ class netboot(StageBase):
>  		self.required_values=[]
>  
>  		try:
> +			# XXX: This code does nothing because the
> for loop below is disabled. if "netboot/packages" in addlargs:
>  				if
> type(addlargs["netboot/packages"]) == types.StringType:
> -
> loopy=[addlargs["netboot/packages"]]
> +					_loopy =
> [addlargs["netboot/packages"]] else:
> -
> loopy=addlargs["netboot/packages"]
> +					_loopy =
> addlargs["netboot/packages"] 
>  		#	for x in loopy:
>  		#
> self.required_values.append("netboot/packages/"+x+"/files") diff
> --git a/setup.py b/setup.py index feca894..27ed2de 100755
> --- a/setup.py
> +++ b/setup.py
> @@ -34,7 +34,7 @@ def _files(prefix, root):
>  
>  	Yielding `(target_dir, (file_source_paths, ...))` tuples.
>  	"""
> -	for dirpath, dirnames, filenames in _os.walk(root):
> +	for dirpath, _dirnames, filenames in _os.walk(root):
>  		reldir = _os.path.relpath(dirpath, root)
>  		install_directory = _posix_path(
>  			_os.path.join(prefix, reldir))

good :)

-- 
Brian Dolbec <dolsen>



      reply	other threads:[~2015-10-06  6:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06  4:06 [gentoo-catalyst] [PATCH] lint: fix up unused variables Mike Frysinger
2015-10-06  6:36 ` Brian Dolbec [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151005233658.37bb76f8.dolsen@gentoo.org \
    --to=dolsen@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox