changeset 375:9314c1008189

aslightly better; still trouble at da end
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 24 Jul 2013 03:10:27 -0700
parents 6e0853b16457
children 3f84a96cccf6
files python/tree.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/python/tree.py	Wed Jul 24 02:38:27 2013 -0700
+++ b/python/tree.py	Wed Jul 24 03:10:27 2013 -0700
@@ -32,11 +32,13 @@
         retval.append('%s%s%s' % ('│' * (indent-1),
                                   '├' if indent else '',
                                   os.path.basename(dirpath)))
+        filenames = sorted(filenames, key=lambda x: x.lower())
         retval.extend(['%s%s%s' % ('│' * (indent),
-                                   '├' if index < len(filenames) -1 else '└',
+        #                                   '├' if (((index < len(filenames) -1)) or dirnames) else '└',
+                                   '├' if (((index < len(filenames) -1)) or dirnames) else '└',
                                     name)
                        for index, name in
-                       enumerate(sorted(filenames, key=lambda x: x.lower()))
+                       enumerate(filenames)
                        ])
     return '\n'.join(retval)