diff options
author | Don Garrett <dgarrett@google.com> | 2014-03-19 14:02:12 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-03-20 23:52:56 +0000 |
commit | 25f309abfacfeaadb205dad2b01597edd151408b (patch) | |
tree | 93a71c02f9b26eda1910ace6bfc4957ffcd4a7d9 /scripts/parallel_emerge.py | |
parent | 0e03049082c78dd0b80a4ff30cb10778675e3c72 (diff) | |
download | chromite-25f309abfacfeaadb205dad2b01597edd151408b.tar.gz |
Fix cros lint issues in chromite/scripts.
Fix or disable all cros lint warnings in scripts.
BUG=None
TEST=Ran pylint.
Change-Id: Iedd2f2e361ea82c082f1c95c9054ac15d19193ff
Reviewed-on: https://chromium-review.googlesource.com/190730
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Diffstat (limited to 'scripts/parallel_emerge.py')
-rw-r--r-- | scripts/parallel_emerge.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/parallel_emerge.py b/scripts/parallel_emerge.py index 4e59572a9..40b5db8cb 100644 --- a/scripts/parallel_emerge.py +++ b/scripts/parallel_emerge.py @@ -58,7 +58,7 @@ if "PORTAGE_USERNAME" not in os.environ: # /usr/lib/portage/pym/. # # TODO(davidjames): Update Portage to expose public APIs for these features. -# pylint: disable=W0212 +# pylint: disable=F0401 from _emerge.actions import adjust_configs from _emerge.actions import load_emerge_config from _emerge.create_depgraph_params import create_depgraph_params @@ -449,6 +449,7 @@ class DepGraphGenerator(object): # Build our own tree from the emerge digraph. deps_tree = {} + # pylint: disable=W0212 digraph = depgraph._dynamic_config.digraph root = emerge.settings["ROOT"] final_db = depgraph._dynamic_config.mydbapi[root] @@ -810,6 +811,8 @@ def PrintDepsMap(deps_map): class EmergeJobState(object): + """Structure describing the EmergeJobState.""" + __slots__ = ["done", "filename", "last_notify_timestamp", "last_output_seek", "last_output_timestamp", "pkgname", "retcode", "start_timestamp", "target", "fetch_only", "unpack_only"] @@ -908,8 +911,10 @@ def EmergeProcess(output, *args, **kwargs): sys.stdin.fileno(): sys.stdin.fileno(), output.fileno(): output.fileno()} if 0 <= vercmp(portage.VERSION, "2.1.11.50"): + # pylint: disable=W0212 portage.process._setup_pipes(fd_pipes, close_fds=False) else: + # pylint: disable=W0212 portage.process._setup_pipes(fd_pipes) # Portage doesn't like when sys.stdin.fileno() != 0, so point sys.stdin @@ -936,6 +941,7 @@ def EmergeProcess(output, *args, **kwargs): sys.stdout.flush() sys.stderr.flush() output.flush() + # pylint: disable=W0212 os._exit(retval) else: # Return the exit code of the subprocess. @@ -1003,6 +1009,7 @@ def EmergeWorker(task_queue, job_queue, emerge, package_db, fetch_only=False, bindb = emerge.trees[root]["bintree"].dbapi # Might be a set, might be a list, might be None; no clue, just use shallow # copy to ensure we can roll it back. + # pylint: disable=W0212 original_remotepkgs = copy.copy(bindb.bintree._remotepkgs) opts, spinner = emerge.opts, emerge.spinner @@ -1175,6 +1182,7 @@ def PrintWorker(queue): class TargetState(object): + """Structure descriting the TargetState.""" __slots__ = ("target", "info", "score", "prefetched", "fetched_successfully") @@ -1200,6 +1208,7 @@ class TargetState(object): class ScoredHeap(object): + """Implementation of a general purpose scored heap.""" __slots__ = ("heap", "_heap_set") @@ -1760,6 +1769,7 @@ def real_main(argv): # packages. portage_upgrade = False root = emerge.settings["ROOT"] + # pylint: disable=W0212 final_db = emerge.depgraph._dynamic_config.mydbapi[root] if root == "/": for db_pkg in final_db.match_pkgs("sys-apps/portage"): @@ -1795,6 +1805,7 @@ def real_main(argv): try: scheduler.Run() finally: + # pylint: disable=W0212 scheduler._Shutdown() scheduler = None |