chore: fix python lint warnings (#14638)

* chore: fix lint warnings

* chore: another try at python import errors

Looks like the problem is that dbus_mock.py is running as
a script but living in the `lib/` directory where it's part of a
module. Moving it up into the `script/` directory seems to
solve the issue.
This commit is contained in:
Charles Kerr 2018-09-16 12:24:07 -05:00 committed by GitHub
parent 6d01952e66
commit a45ded5508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 111 additions and 74 deletions

View file

@ -1,13 +1,15 @@
#!/usr/bin/env python
"""Git helper functions.
Everything in here should be project agnostic, shouldn't rely on project's structure,
and make any assumptions about the passed arguments or calls outcomes.
Everything here should be project agnostic: it shouldn't rely on project's
structure, or make assumptions about the passed arguments or calls' outcomes.
"""
import os
import subprocess
from util import scoped_cwd
from lib.util import scoped_cwd
def is_repo_root(path):
@ -40,7 +42,7 @@ def get_repo_root(path):
return get_repo_root(parent_path)
def apply(repo, patch_path, directory=None, index=False, reverse=False):
def apply_patch(repo, patch_path, directory=None, index=False, reverse=False):
args = ['git', 'apply',
'--ignore-space-change',
'--ignore-whitespace',
@ -64,7 +66,7 @@ def get_patch(repo, commit_hash):
args = ['git', 'diff-tree',
'-p',
commit_hash,
'--' # Explicitly tell Git that `commit_hash` is a revision, not a path.
'--' # Explicitly tell Git `commit_hash` is a revision, not a path.
]
with scoped_cwd(repo):