diff options
author | Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> | 2019-09-28 14:03:20 +0200 |
---|---|---|
committer | Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> | 2019-09-28 14:03:20 +0200 |
commit | f3d63966b944735d2926b0a2d5bd54aff90c1e20 (patch) | |
tree | 588c383da5aeae6b64ed1cbfe7883e1aa284be26 /dofile-in-python/all.do | |
parent | 252568121742f336a9e42e55a8985e5e7c31f49f (diff) |
* refactor dofiles in python
Diffstat (limited to 'dofile-in-python/all.do')
-rw-r--r-- | dofile-in-python/all.do | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dofile-in-python/all.do b/dofile-in-python/all.do index f236774..fb14f11 100644 --- a/dofile-in-python/all.do +++ b/dofile-in-python/all.do @@ -2,10 +2,13 @@ from subprocess import run from time import sleep +def redo_ifchange(dependency): + run(['redo-ifchange', dependency]) + with open('source', 'w') as f: f.write('foo') -run(['redo-ifchange', 'target']) +redo_ifchange('target') with open('target', 'r') as f: target_contents_1 = f.read() @@ -15,7 +18,7 @@ sleep(1) with open('source', 'w') as f: f.write('bar') -run(['redo-ifchange', 'target']) +redo_ifchange('target') with open('target', 'r') as f: target_contents_2 = f.read() |