Skip to content

Commit

Permalink
make flake gods happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 25, 2017
1 parent a9ac157 commit 35bdcf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion homu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ def db_query(db, *args):
with db_query_lock:
db.execute(*args)


class Repository:
treeclosed = -1
gh = None
label = None
db = None

def __init__(self, gh, repo_label, db):
self.gh = gh
self.repo_label = repo_label
Expand All @@ -80,6 +82,7 @@ def update_treeclosed(self, value):
def __lt__(self, other):
return self.gh < other.gh


class PullReqState:
num = 0
priority = 0
Expand Down Expand Up @@ -1088,6 +1091,7 @@ def check_timeout(states, queue_handler):
finally:
time.sleep(3600)


def synchronize(repo_label, repo_cfg, logger, gh, states, repos, db, mergeable_que, my_username, repo_labels):
logger.info('Synchronizing {}...'.format(repo_label))

Expand Down Expand Up @@ -1269,7 +1273,6 @@ def main():
repo_states = {}
repos[repo_label] = Repository(None, repo_label, db)


db_query(db, 'SELECT num, head_sha, status, title, body, head_ref, base_ref, assignee, approved_by, priority, try_, rollup, delegate, merge_sha FROM pull WHERE repo = ?', [repo_label])
for num, head_sha, status, title, body, head_ref, base_ref, assignee, approved_by, priority, try_, rollup, delegate, merge_sha in db.fetchall():
state = PullReqState(num, head_sha, status, db, repo_label, mergeable_que, gh, repo_cfg['owner'], repo_cfg['name'], repos)
Expand Down
2 changes: 1 addition & 1 deletion homu/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def queue(repo_label):

if treeclosed:
status_ext += ' [TREE CLOSED]'

rows.append({
'status': state.get_status(),
'status_ext': status_ext,
Expand Down

0 comments on commit 35bdcf6

Please sign in to comment.