mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-13 07:11:08 +01:00
Fixed some pylint violations in some newly added code.
This commit is contained in:
parent
adf6ee412f
commit
cf63af8819
4 changed files with 19 additions and 16 deletions
|
@ -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"))
|
||||
|
|
|
@ -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__
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue