Releases: anki-code/xontrib-macro
Releases · anki-code/xontrib-macro
0.5.0
0.4.2
0.4.1
Added signal.DisableInterrupt
. This macro allows disabling SIGINT (Ctrl+C) for group of commands.
from xontrib.macro.signal import DisableInterrupt
echo start
with! DisableInterrupt:
echo 'sleep start'
sleep 10
echo 'sleep end'
echo finish
# start
# sleep start
# [Press Ctrl+C]
# KeyboardInterrupt will be raised at the end of current transaction.
# sleep end
# Exception KeyboardInterrupt: KeyboardInterrupt was received during transaction.
0.3.5
0.3.4
Added format
to data.Write
:
from xontrib.macro.data import Write
with! Write('/tmp/t/hello.xsh', chmod=0o700, replace=True, makedir=True, format={'name': 'world'}, verbose=True):
echo {name}
## Make directories: /tmp/t
## Write to file: /tmp/t/hello.xsh
## Set chmod: rw- --- ---
## Set exec: rwx --- ---
/tmp/t/hello.xsh
# world