Skip to content

Commit

Permalink
incident contact (#14)
Browse files Browse the repository at this point in the history
* incident contact

* Python 3.6

* fix flake8
  • Loading branch information
hjacobs committed Apr 26, 2019
1 parent 1e19ffb commit 7e2144e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,6 +1,6 @@
language: python
python:
- "3.4"
- "3.6"
install:
- pip install -r requirements.txt
- pip install coveralls
Expand Down
8 changes: 6 additions & 2 deletions kio/cli.py
Expand Up @@ -79,9 +79,10 @@ def applications():
@output_option
@click.option('-s', '--since')
@click.option('-t', '--team', help='Filter by team')
@click.option('--incident-contact', help='Filter by 24x7 incident contact')
@click.option('-a', '--all', is_flag=True, help='List all applications (also disabled)')
@click.pass_obj
def list_apps(config, output, since, team, **kwargs):
def list_apps(config, output, since, team, incident_contact, **kwargs):
'''List applications'''
url = get_url(config)
token = get_token()
Expand All @@ -101,6 +102,9 @@ def list_apps(config, output, since, team, **kwargs):
if team and row['team_id'] != team:
continue

if incident_contact and row.get('incident_contact', '') != incident_contact:
continue

if row['last_modified'] < since_str:
continue

Expand All @@ -111,7 +115,7 @@ def list_apps(config, output, since, team, **kwargs):
rows.sort(key=lambda r: r['id'])

with OutputFormat(output):
print_table(['id', 'team_id', 'name', 'subtitle', 'last_modified_time'],
print_table(['id', 'team_id', 'incident_contact', 'name', 'subtitle', 'last_modified_time'],
rows, titles={'last_modified_time': 'Modified'}, max_column_widths={'name': 32, 'subtitle': 32})


Expand Down
2 changes: 1 addition & 1 deletion kio/time.py
Expand Up @@ -26,7 +26,7 @@

def normalize_time(s, default=None, past=False):
"""
If a time delta of the form /[+-]?\d+[smdh]/ is given, returns an ISO date string representing the
If a time delta of the form /[+-]?\\d+[smdh]/ is given, returns an ISO date string representing the
current time offset by that delta. If an ISO date string is given, returns it unaltered. If another
string is given and a default is specified, returns the result of normalizing the default. Assumes
all ISO strings omit the "T" between date and time.
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -46,7 +46,8 @@ def read_version(package):
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
]

Expand Down

0 comments on commit 7e2144e

Please sign in to comment.