forked from FPGAwars/icestudio
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request FPGAwars#120 from Jesus89/develop
Add config commands. Configure native binaries. Closes FPGAwars#118
- Loading branch information
Showing
11 changed files
with
144 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# -- This file is part of the Apio project | ||
# -- (C) 2016 FPGAwars | ||
# -- Author Jesús Arroyo | ||
# -- Licence GPLv2 | ||
|
||
import click | ||
|
||
from apio.profile import Profile | ||
|
||
|
||
@click.command('config') | ||
@click.pass_context | ||
@click.option('-l', '--list', is_flag=True, | ||
help='List all configuration parameters.') | ||
@click.option('-e', '--exe', type=click.Choice(['apio', 'native']), | ||
help='Configure executables: `apio` selects apio packages, ' + | ||
'`native` selects system binaries.') | ||
def cli(ctx, list, exe): | ||
"""Apio configuration.""" | ||
|
||
if list: # pragma: no cover | ||
profile = Profile() | ||
exe_mode = profile.get_config_exe() | ||
click.secho('Executable mode: ' + exe_mode, fg='yellow') | ||
elif exe: # pragma: no cover | ||
profile = Profile() | ||
profile.add_config(exe) | ||
profile.save() | ||
click.secho('Executable mode updated: ' + exe, fg='green') | ||
else: | ||
click.secho(ctx.get_help()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
setup( | ||
name='apio', | ||
version='0.1.7.4', | ||
version='0.1.7.5', | ||
description='Experimental micro-ecosystem for open FPGAs', | ||
author='Jesús Arroyo Torrens', | ||
author_email='[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from apio.commands.config import cli as cmd_config | ||
|
||
|
||
def test_config(clirunner, validate_cliresult): | ||
result = clirunner.invoke(cmd_config) | ||
validate_cliresult(result) | ||
|
||
|
||
def test_config_list(clirunner, validate_cliresult): | ||
result = clirunner.invoke(cmd_config, ['--list']) | ||
validate_cliresult(result) | ||
|
||
|
||
def test_config_exe(clirunner, validate_cliresult): | ||
result = clirunner.invoke(cmd_config, ['--exe', 'native']) | ||
validate_cliresult(result) |