index
:
mu
this commit
hlt
main
Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.
Kartik K. Agaram <vc@akkartik.com>
about
summary
refs
log
tree
commit
diff
stats
log msg
author
committer
range
path:
root
/
cpp
Mode
Name
Size
d---------
.traces
8274
log
stats
plain
-rw-r--r--
000organization.cc
5116
log
stats
plain
blame
-rw-r--r--
001help.cc
1507
log
stats
plain
blame
-rw-r--r--
002test.cc
2553
log
stats
plain
blame
-rw-r--r--
003trace.cc
18251
log
stats
plain
blame
-rw-r--r--
003trace.test.cc
4923
log
stats
plain
blame
-rw-r--r--
010vm.cc
8625
log
stats
plain
blame
-rw-r--r--
011load.cc
10131
log
stats
plain
blame
-rw-r--r--
012transform.cc
1724
log
stats
plain
blame
-rw-r--r--
013literal_string.cc
2391
log
stats
plain
blame
-rw-r--r--
014types.cc
2849
log
stats
plain
blame
-rw-r--r--
020run.cc
5537
log
stats
plain
blame
-rw-r--r--
021arithmetic.cc
6865
log
stats
plain
blame
-rw-r--r--
022boolean.cc
2824
log
stats
plain
blame
-rw-r--r--
023jump.cc
3199
log
stats
plain
blame
-rw-r--r--
024compare.cc
7704
log
stats
plain
blame
-rw-r--r--
025trace.cc
651
log
stats
plain
blame
-rw-r--r--
026assert.cc
608
log
stats
plain
blame
-rw-r--r--
027debug.cc
1294
log
stats
plain
blame
-rw-r--r--
030container.cc
5387
log
stats
plain
blame
-rw-r--r--
031address.cc
3471
log
stats
plain
blame
-rw-r--r--
032array.cc
6334
log
stats
plain
blame
-rw-r--r--
033length.cc
880
log
stats
plain
blame
-rw-r--r--
034exclusive_container.cc
3932
log
stats
plain
blame
-rw-r--r--
035call.cc
3129
log
stats
plain
blame
-rw-r--r--
036call_ingredient.cc
4563
log
stats
plain
blame
-rw-r--r--
037call_reply.cc
3358
log
stats
plain
blame
-rw-r--r--
038scheduler.cc
4886
log
stats
plain
blame
-rw-r--r--
039wait.cc
2008
log
stats
plain
blame
-rw-r--r--
040brace.cc
10290
log
stats
plain
blame
-rw-r--r--
041name.cc
7816
log
stats
plain
blame
-rw-r--r--
042new.cc
5498
log
stats
plain
blame
-rw-r--r--
043space.cc
4496
log
stats
plain
blame
-rw-r--r--
044space_surround.cc
1885
log
stats
plain
blame
-rw-r--r--
045closure_name.cc
5878
log
stats
plain
blame
-rw-r--r--
049scenario_helpers.cc
9126
log
stats
plain
blame
-rw-r--r--
050scenario.cc
6688
log
stats
plain
blame
-rw-r--r--
051scenario_test.mu
430
log
stats
pl
=
test
if
action
is
None
:
action
=
self
.
apps
.
apply
(
app
,
context
)
if
action
is
None
:
return
self
.
_log
(
"No action found!"
)
if
action
is
None
:
return
self
.
_log
(
"No way of determining the action!"
)
# Preconditions
context
.
squash_flags
()
popen_kws
=
context
.
popen_kws
# shortcut
toggle_ui
=
True
pipe_output
=
False
popen_kws
[
'args'
]
=
action
if
'shell'
not
in
popen_kws
:
popen_kws
[
'shell'
]
=
isinstance
(
action
,
str
)
if
'stdout'
not
in
popen_kws
:
popen_kws
[
'stdout'
]
=
sys
.
stdout
if
'stderr'
not
in
popen_kws
:
popen_kws
[
'stderr'
]
=
sys
.
stderr
# Evaluate the flags to determine keywords
# for Popen() and other variables
if
'p'
in
context
.
flags
:
popen_kws
[
'stdout'
]
=
PIPE
popen_kws
[
'stderr'
]
=
PIPE
toggle_ui
=
False
pipe_output
=
True
context
.
wait
=
False
if
's'
in
context
.
flags
or
'd'
in
context
.
flags
:
for
key
in
(
'stdout'
,
'stderr'
,
'stdin'
):
popen_kws
[
key
]
=
devnull
if
'd'
in
context
.
flags
:
toggle_ui
=
False
context
.
wait
=
False
# Finally, run it
if
toggle_ui
:
self
.
_activate_ui
(
False
)
try
:
process
=
None
try
:
process
=
Popen
(
**
popen_kws
)
except
:
self
.
_log
(
"Failed to run: "
+
str
(
action
))
else
:
if
context
.
wait
:
waitpid_no_intr
(
process
.
pid
)
finally
:
if
toggle_ui
:
self
.
_activate_ui
(
True
)
if
pipe_output
and
process
:
return
self
(
action
=
'less'
,
app
=
'pager'
,
try_app_first
=
True
,
stdin
=
process
.
stdout
)
return
process