From 6577c9725e74c564f23a87e1f91050900f258fe9 Mon Sep 17 00:00:00 2001 From: erkin Date: Wed, 24 Nov 2021 19:43:01 +0300 Subject: T3356: Rewrite remote.py --- python/vyos/util.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'python/vyos/util.py') diff --git a/python/vyos/util.py b/python/vyos/util.py index 9aa1f98d2..d8e83ab8d 100644 --- a/python/vyos/util.py +++ b/python/vyos/util.py @@ -856,6 +856,20 @@ def make_incremental_progressbar(increment: float): while True: yield +def begin(*args): + """ + Evaluate arguments in order and return the result of the *last* argument. + For combining multiple expressions in one statement. Useful for lambdas. + """ + return args[-1] + +def begin0(*args): + """ + Evaluate arguments in order and return the result of the *first* argument. + For combining multiple expressions in one statement. Useful for lambdas. + """ + return args[0] + def is_systemd_service_active(service): """ Test is a specified systemd service is activated. Returns True if service is active, false otherwise. -- cgit v1.2.3