395
395
"""Parse an interval string as documented by Mandos before 1.6.1,
396
396
and return a datetime.timedelta
398
>>> parse_pre_1_6_1_interval('7d') == datetime.timedelta(days=7)
400
>>> parse_pre_1_6_1_interval('60s') == datetime.timedelta(0, 60)
402
>>> parse_pre_1_6_1_interval('60m') == datetime.timedelta(hours=1)
404
>>> parse_pre_1_6_1_interval('24h') == datetime.timedelta(days=1)
406
>>> parse_pre_1_6_1_interval('1w') == datetime.timedelta(days=7)
408
>>> parse_pre_1_6_1_interval('5m 30s') == datetime.timedelta(0, 330)
410
>>> parse_pre_1_6_1_interval('') == datetime.timedelta(0)
398
>>> parse_pre_1_6_1_interval("7d") == datetime.timedelta(days=7)
400
>>> parse_pre_1_6_1_interval("60s") == datetime.timedelta(0, 60)
402
>>> parse_pre_1_6_1_interval("60m") == datetime.timedelta(hours=1)
404
>>> parse_pre_1_6_1_interval("24h") == datetime.timedelta(days=1)
406
>>> parse_pre_1_6_1_interval("1w") == datetime.timedelta(days=7)
408
>>> parse_pre_1_6_1_interval("5m 30s") == datetime.timedelta(0, 330)
410
>>> parse_pre_1_6_1_interval("") == datetime.timedelta(0)
412
412
>>> # Ignore unknown characters, allow any order and repetitions
413
>>> parse_pre_1_6_1_interval('2dxy7zz11y3m5m') == datetime.timedelta(2, 480, 18000)
413
>>> parse_pre_1_6_1_interval("2dxy7zz11y3m5m") == datetime.timedelta(2, 480, 18000)
876
876
{key: properties[key]
877
877
for key in self.all_keywords}
878
878
for properties in clients.values()}
879
print(json.dumps(data, indent=4, separators=(',', ': ')))
879
print(json.dumps(data, indent=4, separators=(",", ": ")))
882
882
class PrintTable(Output):