Fixed some pylint violations in some newly added code.

This commit is contained in:
Adam Waldenberg 2013-07-14 04:47:34 +02:00
parent adf6ee412f
commit cf63af8819
4 changed files with 19 additions and 16 deletions

View file

@ -21,6 +21,7 @@ from __future__ import unicode_literals
import extensions
import filtering
import format
import interval
import missing
import optval
import os
@ -49,8 +50,8 @@ def __read_git_config_bool__(repo, variable):
return False
def __read_git_config_string__(repo, variable):
string = __read_git_config__(repo, variable)
return (True, string) if len(string) > 0 else (False, None)
string = __read_git_config__(repo, variable)
return (True, string) if len(string) > 0 else (False, None)
def init(run):
missing.set_checkout_missing(__read_git_config_bool__(run.repo, "checkout-missing"))

View file

@ -32,11 +32,12 @@ DEFAULT_FORMAT = __available_formats__[2]
__selected_format__ = DEFAULT_FORMAT
class InvalidFormatError(Exception):
def __init__(self, msg):
self.msg = msg
def __init__(self, message):
super(InvalidFormatError, self).__init__(message)
self.message = message
def msg():
return self.msg
def msg(self):
return self.message
def select(format):
global __selected_format__

View file

@ -20,11 +20,12 @@ from __future__ import unicode_literals
import getopt
class InvalidOptionArgument(Exception):
def __init__(self, msg):
self.msg = msg
def __init__(self, message):
super(InvalidOptionArgument, self).__init__(message)
self.message = message
def msg():
return self.msg
def msg(self):
return self.message
def __find_arg_in_options__(arg, options):
for opt in options:
@ -36,10 +37,10 @@ def __find_arg_in_options__(arg, options):
def __find_options_to_extend__(long_options):
options_to_extend = []
for n, arg in enumerate(long_options):
for num, arg in enumerate(long_options):
arg = arg.split(":")
if len(arg) == 2:
long_options[n] = arg[0] + "="
long_options[num] = arg[0] + "="
options_to_extend.append(("--" + arg[0], arg[1]))
return options_to_extend
@ -49,10 +50,10 @@ def __find_options_to_extend__(long_options):
def gnu_getopt(args, options, long_options):
options_to_extend = __find_options_to_extend__(long_options)
for n, arg in enumerate(args):
for num, arg in enumerate(args):
opt = __find_arg_in_options__(arg, options_to_extend)
if opt:
args[n] = arg + "=" + opt[1]
args[num] = arg + "=" + opt[1]
return getopt.gnu_getopt(args, options, long_options)

View file

@ -114,6 +114,6 @@ def convert_command_line_to_utf8():
for arg in sys.argv:
argv.append(arg.decode(sys.stdin.encoding, "replace"))
return argv;
return argv
except AttributeError:
return sys.argv;
return sys.argv