Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,5 @@ nosetests.xml | |
.pydevproject | ||
|
||
docs/_build | ||
.*sw? | ||
bin/pynsot |
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,7 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from pynsot.cli import main | ||
|
||
if __name__ == '__main__': | ||
main() |
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,43 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Command-line interface internals. | ||
""" | ||
|
||
import pynsot | ||
from pynsot.client import Client | ||
import argparse | ||
import sys | ||
|
||
|
||
def parse_args(argv=None): | ||
if argv is None: | ||
argv = sys.argv[1:] | ||
print argv | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--version', '-V', action='version', | ||
version='%(prog)s ' + pynsot.__version__) | ||
parser.add_argument('--verbose', '-v', action='store_true', | ||
help='toggle verbosity') | ||
|
||
subparsers = parser.add_subparsers(help='Help for objects', | ||
title='Objects', | ||
description='Valid objects') | ||
|
||
# Create the parser for network | ||
parser_network = subparsers.add_parser('networks', help='Network objects') | ||
parser_network.add_argument('--address', '-a', type=str, | ||
help='Network address') | ||
|
||
attribute_parser = subparsers.add_parser('attributes', help='Attributes') | ||
device_parser = subparsers.add_parser('devices', help='Devices') | ||
user_parser = subparsers.add_parser('users', help='Users') | ||
|
||
args = parser.parse_args(argv) | ||
return args | ||
|
||
|
||
def main(): | ||
args = parse_args() | ||
print args |
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.0.3' | ||
__version__ = '0.0.4' |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
slumber==0.6.2 | ||
tabulate==0.7.3 |