changeset 381:397d0ac832b6

blow this popsicle stand
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 26 Jul 2013 03:33:17 -0700
parents 5b94b85763a0
children 9ac9561b6574
files python/tree.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/python/tree.py	Thu Jul 25 04:48:20 2013 -0700
+++ b/python/tree.py	Fri Jul 26 03:33:17 2013 -0700
@@ -24,23 +24,26 @@
 def tree(directory):
     retval = []
     level = depth(directory)
+    pre = []
     directories = {}
     lvlndctr = []
     last = {}
     passed_last = {}
     columns = []
     lastdepth = depth
+    indent = 0
     for dirpath, dirnames, filenames in os.walk(directory, topdown=True):
         basename = os.path.basename(dirpath)
         parent = os.path.abspath(os.path.dirname(dirpath))
         indent = depth(dirpath) - level
+        import pdb; pdb.set_trace()
         dirnames[:] = sorted(dirnames, key=lambda x: x.lower())
         last[os.path.abspath(dirpath)] = dirnames and dirnames[-1] or None
         directories[dirpath] = dirnames
-        
-        retval.append('%s%s%s' % ('│' * (indent-1),
-                                  ('├' if basename == basename else '└') if indent else '',
-                                  basename))
+
+        retval.append('%s%s%s %s' % ('│' * (indent-1),
+                                     ('├' if basename == basename else '└') if indent else '',
+                                     basename))
         filenames = sorted(filenames, key=lambda x: x.lower())
         retval.extend(['%s%s%s' % ('│' * (indent),
                                    '├' if (((index < len(filenames) -1)) or dirnames) else '└',