diff options
author | Milan Svoboda <msvoboda@ra.rockwell.com> | 2014-11-22 09:14:03 +0100 |
---|---|---|
committer | Milan Svoboda <msvoboda@ra.rockwell.com> | 2014-11-22 09:14:03 +0100 |
commit | 9f7001379a88666ad07c7d04a5164ef802499481 (patch) | |
tree | 7f639405d336e885dd35d4e784679529cb6c0abc /ranger | |
parent | 518cda572449aa16f2cfdbc7690a5ad030f145b5 (diff) | |
download | ranger-9f7001379a88666ad07c7d04a5164ef802499481.tar.gz |
follow symlinks to directories if flat is not -1
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/container/directory.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py index 506d1052..f0cb4067 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -47,9 +47,10 @@ def accept_file(fname, directory, hidden_filter, name_filter): def walklevel(some_dir, level): some_dir = some_dir.rstrip(os.path.sep) + followlinks = True if level > 0 else False assert os.path.isdir(some_dir) num_sep = some_dir.count(os.path.sep) - for root, dirs, files in os.walk(some_dir): + for root, dirs, files in os.walk(some_dir, followlinks=followlinks): yield root, dirs, files num_sep_this = root.count(os.path.sep) if level != -1 and num_sep + level <= num_sep_this: |