# HG changeset patch # User Windel Bouwman # Date 1391773915 -3600 # Node ID 87feb8a23b4d5a5e517a6098d7a3bd517a46dba9 # Parent a78b41ff6ad2913cbdae9d4d1197cd83f27cb86d Added task list command diff -r a78b41ff6ad2 -r 87feb8a23b4d python/ppci/buildtasks.py --- a/python/ppci/buildtasks.py Fri Feb 07 12:39:59 2014 +0100 +++ b/python/ppci/buildtasks.py Fri Feb 07 12:51:55 2014 +0100 @@ -80,13 +80,4 @@ pass -def load_recipe(recipe_file, runner): - """ Loads a recipe dictionary into a task runner """ - for command, value in recipe: - if command == 'compile': - sources = value[''] - target = value['target'] - runner.add_task(Compile()) - else: - raise Exception() diff -r a78b41ff6ad2 -r 87feb8a23b4d python/ppci/tasks.py --- a/python/ppci/tasks.py Fri Feb 07 12:39:59 2014 +0100 +++ b/python/ppci/tasks.py Fri Feb 07 12:51:55 2014 +0100 @@ -27,11 +27,15 @@ self.dependencies.append(task) return task + def __repr__(self): + return 'Task "{}"'.format(self.name) + class TaskRunner: + """ Basic task runner that can run some tasks in sequence """ def __init__(self): self.task_list = [] - + def add_task(self, task): self.task_list.append(task) @@ -44,3 +48,8 @@ print('Error: {}'.format(e)) return 1 return 0 + + def display(self): + """ Display task how they would be run """ + for task in self.task_list: + print(task) diff -r a78b41ff6ad2 -r 87feb8a23b4d python/zcc.py --- a/python/zcc.py Fri Feb 07 12:39:59 2014 +0100 +++ b/python/zcc.py Fri Feb 07 12:51:55 2014 +0100 @@ -30,6 +30,7 @@ parser.add_argument('--log', help='Log level (INFO,DEBUG,[WARN])', type=logLevel, default='WARN') + parser.add_argument('--display-build-steps', action='store_true') sub_parsers = parser.add_subparsers(title='commands', description='possible commands', dest='command') recipe_parser = sub_parsers.add_parser('recipe', help="Bake recipe") @@ -103,7 +104,11 @@ else: raise NotImplementedError('Invalid option') - res = runner.run_tasks() + if args.display_build_steps: + runner.display() + res = 0 + else: + res = runner.run_tasks() logging.getLogger().removeHandler(ch) return res diff -r a78b41ff6ad2 -r 87feb8a23b4d readme.rst --- a/readme.rst Fri Feb 07 12:39:59 2014 +0100 +++ b/readme.rst Fri Feb 07 12:51:55 2014 +0100 @@ -19,6 +19,7 @@ --------------------- * python3.3 +* pyyaml for yaml module * (optional) pyqt5, pyqt4 or pyside How to start the IDE