diff options
author | Victor Häggqvist <[email protected]> | 2014-09-02 22:29:48 +0200 |
---|---|---|
committer | Victor Häggqvist <[email protected]> | 2014-09-02 22:29:48 +0200 |
commit | 068f4b504e0e0454af1a325939f9ac386016ba62 (patch) | |
tree | caf050eabc5be30c1f19c88a151f836238b896a4 /xboomx | |
parent | 1958c3c47cb5a25e8258961c5784e4bfffc65ff8 (diff) |
filter uniqe items and blacklist
Diffstat (limited to 'xboomx')
-rwxr-xr-x | xboomx/bin/xboomx | 2 | ||||
-rwxr-xr-x | xboomx/bin/xboomx_path.py | 22 |
2 files changed, 17 insertions, 7 deletions
diff --git a/xboomx/bin/xboomx b/xboomx/bin/xboomx index 2b4d266..c8865dc 100755 --- a/xboomx/bin/xboomx +++ b/xboomx/bin/xboomx @@ -1,6 +1,4 @@ #!/usr/bin/python -import fileinput - import subprocess from xboomx.config import config import xboomx.db diff --git a/xboomx/bin/xboomx_path.py b/xboomx/bin/xboomx_path.py index 67a1cb1..56779b3 100755 --- a/xboomx/bin/xboomx_path.py +++ b/xboomx/bin/xboomx_path.py @@ -1,11 +1,23 @@ #!/usr/bin/python import os +from xboomx.config import config -pathes = os.environ['PATH'].split(':') +def main(): + pathes = os.environ['PATH'].split(':') + items = [] -for path in pathes: - if os.path.isdir(path): - for f in os.listdir(path): - print f + for path in pathes: + if os.path.isdir(path): + for f in os.listdir(path): + items.append(f) + + uniqeitems = list(set(items)) + + ignorelist = config.get("ignorelist",""); + for item in uniqeitems: + if item not in ignorelist: + print item + +main()
\ No newline at end of file |