Skip to content

Commit

Permalink
Factor out problem buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstanek committed Jun 17, 2016
1 parent f5c57d8 commit d60fbbd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions botbot/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def remove_ignored(fi, ignore):
for finfo in self.checklist:
if finfo['isfile']:
finfo['lastcheck'] = int(time.time())
self.check_file(finfo, status=verbose)
result = self.check_file(finfo, status=verbose)
self.process_checked_file(result)
self.db.store_file_problems(self.checked)

self.status['time'] = time.time() - starttime
Expand All @@ -170,12 +171,15 @@ def check_file(self, finfo, status=False):
result['problems'].add(prob)
self.status['probcount'] += 1

self.checked.append(result)
self.status['checked'] += 1

if status:
self.reporter.write_status(40)

return result

def process_checked_file(self, result):
self.checked.append(result)
self.status['checked'] += 1

def is_link(path):
"""Check if the given path is a symbolic link"""
return os.path.islink(path) or os.path.abspath(path) != os.path.realpath(path)

0 comments on commit d60fbbd

Please sign in to comment.