Move into the 21st century by fixing some pylint warnings.
This commit is contained in:
parent
1966a0fac7
commit
e1327540fb
22 changed files with 797 additions and 388 deletions
|
|
@ -7,22 +7,29 @@ vars_init.init_no_state()
|
|||
import paths
|
||||
from logs import err
|
||||
|
||||
if len(sys.argv[1:]) != 1:
|
||||
err('%s: exactly one argument expected.\n' % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
want = sys.argv[1]
|
||||
if not want:
|
||||
err('cannot build the empty target ("").\n')
|
||||
sys.exit(204)
|
||||
def main():
|
||||
if len(sys.argv[1:]) != 1:
|
||||
err('%s: exactly one argument expected.\n' % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
abswant = os.path.abspath(want)
|
||||
for dodir,dofile,basedir,basename,ext in paths.possible_do_files(abswant):
|
||||
dopath = os.path.join('/', dodir, dofile)
|
||||
relpath = os.path.relpath(dopath, '.')
|
||||
exists = os.path.exists(dopath)
|
||||
assert('\n' not in relpath)
|
||||
print relpath
|
||||
if exists:
|
||||
sys.exit(0)
|
||||
sys.exit(1) # no appropriate dofile found
|
||||
want = sys.argv[1]
|
||||
if not want:
|
||||
err('cannot build the empty target ("").\n')
|
||||
sys.exit(204)
|
||||
|
||||
abswant = os.path.abspath(want)
|
||||
pdf = paths.possible_do_files(abswant)
|
||||
for dodir, dofile, basedir, basename, ext in pdf:
|
||||
dopath = os.path.join('/', dodir, dofile)
|
||||
relpath = os.path.relpath(dopath, '.')
|
||||
exists = os.path.exists(dopath)
|
||||
assert '\n' not in relpath
|
||||
print relpath
|
||||
if exists:
|
||||
sys.exit(0)
|
||||
sys.exit(1) # no appropriate dofile found
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue