Merge the two files into env, and make each command explicitly call the function that sets it up in the way that's needed for that command. This means we can finally just import all the modules at the top of each file, without worrying about import order. Phew. While we're here, remove the weird auto-appending-'all'-to-targets feature in env.init(). Instead, do it explicitly, and only from redo and redo-ifchange, only if is_toplevel and no other targets are given.
19 lines
384 B
Python
19 lines
384 B
Python
import sys, os
|
|
import env, state
|
|
from logs import err
|
|
|
|
|
|
def main():
|
|
state.init([])
|
|
if len(sys.argv[1:]) != 0:
|
|
err('%s: no arguments expected.\n' % sys.argv[0])
|
|
sys.exit(1)
|
|
|
|
cwd = os.getcwd()
|
|
for f in state.files():
|
|
if f.is_target():
|
|
print state.relpath(os.path.join(env.v.BASE, f.name), cwd)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|