Changeset 06dad0a in rtems-source-builder


Ignore:
Timestamp:
Apr 13, 2013, 12:30:07 AM (6 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
9bd29bb
Parents:
7e48e8f
Message:

Make exists support lists. Add a path expander call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/path.py

    r7e48e8f r06dad0a  
    7373    return shell(root), ext
    7474
    75 def exists(path):
    76     return os.path.exists(host(path))
     75def exists(paths):
     76    if type(paths) == list:
     77        results = []
     78        for p in paths:
     79            results += [os.path.exists(host(p))]
     80        return results
     81    return os.path.exists(host(paths))
    7782
    7883def isdir(path):
     
    117122    return
    118123
     124def expand(name, paths):
     125    l = []
     126    for p in paths:
     127        l += [join(p, name)]
     128    return l
     129
    119130if __name__ == '__main__':
    120131    print host('/a/b/c/d-e-f')
Note: See TracChangeset for help on using the changeset viewer.