Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: recipe_engine/bundle.py

Issue 2702313003: Remove unused imports and fix some other linter errors. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | recipe_engine/checker.py » ('j') | recipe_engine/package.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The LUCI Authors. All rights reserved. 2 # Copyright 2016 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 """Bundles a universe_view into a standalone folder. 6 """Bundles a universe_view into a standalone folder.
7 7
8 This captures the result of doing all the network operations that recipe_engine 8 This captures the result of doing all the network operations that recipe_engine
9 might do at startup. 9 might do at startup.
10 """ 10 """
11 11
12 from __future__ import absolute_import 12 from __future__ import absolute_import
13 import errno 13 import errno
14 import logging 14 import logging
15 import os 15 import os
16 import io 16 import io
17 import re
18 import shutil 17 import shutil
19 import stat 18 import stat
20 import subprocess 19 import subprocess
21 import sys 20 import sys
22 import types
23 21
24 LOGGER = logging.getLogger(__name__) 22 LOGGER = logging.getLogger(__name__)
25 23
26 def prepare_destination(destination): 24 def prepare_destination(destination):
27 LOGGER.info('prepping destination %s', destination) 25 LOGGER.info('prepping destination %s', destination)
28 destination = os.path.abspath(destination) 26 destination = os.path.abspath(destination)
29 if os.path.exists(destination): 27 if os.path.exists(destination):
30 LOGGER.fatal( 28 LOGGER.fatal(
31 'directory %s already exists! The directory must not exist to use it as ' 29 'directory %s already exists! The directory must not exist to use it as '
32 'a bundle target.', destination) 30 'a bundle target.', destination)
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 will be tuned to run commands using this package. 117 will be tuned to run commands using this package.
120 universe (loader.RecipeUniverse) - All of the recipes necessary to support 118 universe (loader.RecipeUniverse) - All of the recipes necessary to support
121 root_package. 119 root_package.
122 destination (str) - Path to the bundle output folder. This folder should not 120 destination (str) - Path to the bundle output folder. This folder should not
123 exist before calling this function. 121 exist before calling this function.
124 """ 122 """
125 destination = prepare_destination(destination) 123 destination = prepare_destination(destination)
126 for pkg in universe.packages: 124 for pkg in universe.packages:
127 export_package(pkg, destination) 125 export_package(pkg, destination)
128 prep_recipes_py(universe, root_package, destination) 126 prep_recipes_py(universe, root_package, destination)
OLDNEW
« no previous file with comments | « no previous file | recipe_engine/checker.py » ('j') | recipe_engine/package.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698