Skip to content

Commit

Permalink
pep8 and pylint cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Florath <[email protected]>
  • Loading branch information
florath committed May 6, 2017
1 parent b80bec2 commit c015be2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
9 changes: 5 additions & 4 deletions rmtoo/lib/analytics/TopicCohe.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def topic_set_post(self, topic_set):

for topic, cnt in iteritems(self.__tcnt):
if cnt[0] <= cnt[1]:
self.add_result(Result("TopicCohe", topic,
- 10, ["%s: Topic coherence inadequate: "
"inner %d / outer %d"
% (topic, cnt[0], cnt[1])]))
self.add_result(Result(
"TopicCohe", topic,
- 10, ["%s: Topic coherence inadequate: "
"inner %d / outer %d"
% (topic, cnt[0], cnt[1])]))
3 changes: 1 addition & 2 deletions rmtoo/lib/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import logging




LOGGING_CONFIG = {
"stdout": {
"loglevel": logging.WARN,
Expand Down Expand Up @@ -149,6 +147,7 @@ def configure_logging(cfg, mstderr):

tracer.debug("rmtoo logging system configured.")


# The following names are uses as logging instances and therefore
# should be lower case.
# pylint: disable=invalid-name
Expand Down
2 changes: 0 additions & 2 deletions rmtoo/lib/vcs/FileInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
'''
from __future__ import unicode_literals

import os

from six import iteritems

from rmtoo.lib.vcs.Interface import Interface
Expand Down
2 changes: 0 additions & 2 deletions rmtoo/lib/vcs/FileSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import stat
import time

from six import iteritems

from rmtoo.lib.configuration.Cfg import Cfg
from rmtoo.lib.vcs.Interface import Interface
from rmtoo.lib.vcs.FileInterface import FileInterface
Expand Down
19 changes: 9 additions & 10 deletions rmtoo/lib/vcs/Git.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import os

import git
from six import iteritems

from rmtoo.lib.configuration.Cfg import Cfg
from rmtoo.lib.vcs.Interface import Interface
Expand Down Expand Up @@ -65,21 +64,21 @@ def __setup_repo(self, directory):
repo_found = False
while len(directory) > 1:
try:
tracer.debug("using [%s] as sample directory" % directory)
tracer.debug("using [%s] as sample directory", directory)
self.__repo = git.Repo(directory)
repo_found = True
break
except (git.exc.InvalidGitRepositoryError,
git.exc.NoSuchPathError):
tracer.debug("Sample directory [%s] does not exists" %
tracer.debug("Sample directory [%s] does not exists",
directory)
directory = os.path.dirname(directory)
if not repo_found:
assert False

# :-4: cut off the '/.git'.
self.__repo_base_dir = self.__repo.git_dir[:-5]
tracer.debug("repository base directory [%s]" % self.__repo_base_dir)
tracer.debug("repository base directory [%s]", self.__repo_base_dir)

def __init__(self, config):
tracer.info("called")
Expand All @@ -89,9 +88,9 @@ def __init__(self, config):
self.__end_vers = cfg.get_rvalue("end_vers")
self.__topic_root_node = cfg.get_rvalue("topic_root_node")
tracer.debug("start version [%s] end version [%s] "
"topic root node [%s]"
% (self.__start_vers, self.__end_vers,
self.__topic_root_node))
"topic root node [%s]",
self.__start_vers, self.__end_vers,
self.__topic_root_node)

# When the directory is not absolute, convert it to an
# absolute path that it can be compared to the outcome of the
Expand All @@ -104,7 +103,7 @@ def __init__(self, config):
def get_commits(self):
'''Return an iterator for all the commits.'''
return self.__repo.iter_commits(
self.__start_vers + ".." + self.__end_vers)
self.__start_vers + ".." + self.__end_vers)

def get_timestamp(self, commit):
'''Return the commit time.'''
Expand All @@ -125,8 +124,8 @@ def __init__(self, base_dir, sub_dir, blob):
self.__sub_dirname = os.path.join(*self.__sub_dir)
tracer.debug(self)
self.__filename = os.path.join(
self.__base_dirname, self.__sub_dirname,
self.__blob.name)
self.__base_dirname, self.__sub_dirname,
self.__blob.name)

def __str__(self):
'''Returns the string representation.'''
Expand Down

0 comments on commit c015be2

Please sign in to comment.