changeset 429:9b7f5e31b465

python/tree.py
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 07 Aug 2013 06:33:16 -0700
parents 59e6c8115a97
children 92ee74af9456
files python/tree.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/python/tree.py	Tue Aug 06 23:08:42 2013 -0700
+++ b/python/tree.py	Wed Aug 07 06:33:16 2013 -0700
@@ -68,6 +68,17 @@
 class DirectoryTree(Tree):
     """directory structure as a tree"""
 
+    def __init__(self, directory):
+        self.directory = directory
+        self._return_type = os.path.abspath
+
+    def children(self):
+        return os.listdir(self.directory) # -> self._return_type
+
+## Serializers
+
+# How to serialize a tree -> JSON?
+
 ###
 
 def tree(directory,