Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve serve command #771

Merged
merged 4 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 24.9.5 [#771](https://github.com/openfisca/openfisca-core/pull/771)

- Improve serve command by documenting the bind option
- Avoid crashing when no arguments are supplied

### 24.9.4 [#774](https://github.com/openfisca/openfisca-core/pull/774)

- Clarify the error message when assigning a value larger than MaxInt32 to an 'int' variable
Expand Down
5 changes: 3 additions & 2 deletions openfisca_core/scripts/openfisca_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
def get_parser():
parser = argparse.ArgumentParser()

subparsers = parser.add_subparsers(help='Available commands')
parser_serve = subparsers.add_parser('serve', help='Run the OpenFisca Web API')
subparsers = parser.add_subparsers(help = 'Available commands', dest = 'command')
subparsers.required = True # Can be added as an argument of add_subparsers in Python 3
parser_serve = subparsers.add_parser('serve', help = 'Run the OpenFisca Web API')
parser_serve = define_command_line_options(parser_serve)

return parser
Expand Down
2 changes: 1 addition & 1 deletion openfisca_web_api/scripts/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def define_command_line_options(parser):
parser = add_tax_benefit_system_arguments(parser)

# Define server configuration
parser.add_argument('-p', '--port', action = 'store', help = "port to serve on", type = int)
parser.add_argument('-p', '--port', action = 'store', help = "port to serve on (use --bind to specify host and port)", type = int)
parser.add_argument('--tracker-url', action = 'store', help = "tracking service url", type = str)
parser.add_argument('--tracker-idsite', action = 'store', help = "tracking service id site", type = int)
parser.add_argument('--tracker-token', action = 'store', help = "tracking service authentication token", type = str)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

setup(
name = 'OpenFisca-Core',
version = '24.9.5',
version = '24.9.6',
author = 'OpenFisca Team',
author_email = 'contact@openfisca.org',
classifiers = [
Expand Down