🎨 Remove std case from conditional stmt #12
This commit is contained in:
parent
4e01b8a5c7
commit
cc16378233
13
ldpy.py
13
ldpy.py
|
@ -115,16 +115,15 @@ def parse_args(args=sys.argv[1:]):
|
||||||
|
|
||||||
def get_last_entries(entries_nb):
|
def get_last_entries(entries_nb):
|
||||||
"""Get the last n entries from a stream."""
|
"""Get the last n entries from a stream."""
|
||||||
if entries_nb in LAST_E_CHOICES:
|
if entries_nb not in LAST_E_CHOICES:
|
||||||
logger.debug("Wait before getting '%s' entries!", entries_nb)
|
|
||||||
query = {"size": entries_nb}
|
|
||||||
last_entries = client.opnsrch_clt.search(body=query)
|
|
||||||
logger.debug(pf(last_entries))
|
|
||||||
|
|
||||||
else:
|
|
||||||
logger.critical("'%s' is not in '%s'", entries_nb, LAST_E_CHOICES)
|
logger.critical("'%s' is not in '%s'", entries_nb, LAST_E_CHOICES)
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
|
logger.debug("Wait before getting '%s' entries!", entries_nb)
|
||||||
|
query = {"size": entries_nb}
|
||||||
|
last_entries = client.opnsrch_clt.search(body=query)
|
||||||
|
logger.debug(pf(last_entries))
|
||||||
|
|
||||||
return last_entries
|
return last_entries
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user