OLD | NEW |
1 import ast | 1 import ast |
2 import collections | 2 import collections |
3 import contextlib | 3 import contextlib |
4 import copy | 4 import copy |
5 import functools | 5 import functools |
6 import itertools | 6 import itertools |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 for repo in self._repos.values(): | 610 for repo in self._repos.values(): |
611 for subdir in repo.recipe_dirs: | 611 for subdir in repo.recipe_dirs: |
612 yield str(subdir) | 612 yield str(subdir) |
613 | 613 |
614 @property | 614 @property |
615 def all_module_dirs(self): | 615 def all_module_dirs(self): |
616 for repo in self._repos.values(): | 616 for repo in self._repos.values(): |
617 for subdir in repo.module_dirs: | 617 for subdir in repo.module_dirs: |
618 yield str(subdir) | 618 yield str(subdir) |
619 | 619 |
| 620 @property |
| 621 def engine_recipes_py(self): |
| 622 return os.path.join(self._context.repo_root, 'recipes.py') |
| 623 |
620 | 624 |
621 def _run_cmd(cmd, cwd=None): | 625 def _run_cmd(cmd, cwd=None): |
622 cwd_str = ' (in %s)' % cwd if cwd else '' | 626 cwd_str = ' (in %s)' % cwd if cwd else '' |
623 logging.info('%s%s', cmd, cwd_str) | 627 logging.info('%s%s', cmd, cwd_str) |
624 subprocess.check_call(cmd, cwd=cwd) | 628 subprocess.check_call(cmd, cwd=cwd) |
625 | 629 |
626 | 630 |
627 def _merge2(xs, ys, compare=lambda x, y: x <= y): | 631 def _merge2(xs, ys, compare=lambda x, y: x <= y): |
628 """Merges two sorted iterables, preserving sort order. | 632 """Merges two sorted iterables, preserving sort order. |
629 | 633 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 >>> d = { 'x': 1, 'y': 2 } | 696 >>> d = { 'x': 1, 'y': 2 } |
693 >>> sorted(_updated(d, { 'y': 3, 'z': 4 }).items()) | 697 >>> sorted(_updated(d, { 'y': 3, 'z': 4 }).items()) |
694 [('x', 1), ('y', 3), ('z', 4)] | 698 [('x', 1), ('y', 3), ('z', 4)] |
695 >>> sorted(d.items()) | 699 >>> sorted(d.items()) |
696 [('x', 1), ('y', 2)] | 700 [('x', 1), ('y', 2)] |
697 """ | 701 """ |
698 | 702 |
699 d = copy.copy(d) | 703 d = copy.copy(d) |
700 d.update(updates) | 704 d.update(updates) |
701 return d | 705 return d |
OLD | NEW |