diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-08 11:54:49 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-08 11:54:49 -0500 |
| commit | d312e270ed5c2926c8651291a4026062213876f8 (patch) | |
| tree | 94992d8562332ae84be9f2b5aba169f0e287ea51 /parse/dir_map.py | |
| parent | 2b416f696a50f4ae264d5aec8c78fa7686cc7927 (diff) | |
ColMaps are now created by ColMapBuilders which order columns by their number
of distinct values.
Diffstat (limited to 'parse/dir_map.py')
| -rw-r--r-- | parse/dir_map.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/parse/dir_map.py b/parse/dir_map.py index b864318..51a1390 100644 --- a/parse/dir_map.py +++ b/parse/dir_map.py | |||
| @@ -53,7 +53,9 @@ class DirMap(object): | |||
| 53 | 53 | ||
| 54 | write2([out_dir], self.root) | 54 | write2([out_dir], self.root) |
| 55 | 55 | ||
| 56 | def __read(self, in_dir): | 56 | @staticmethod |
| 57 | def read(in_dir): | ||
| 58 | dir_map = DirMap() | ||
| 57 | if not os.path.exists(in_dir): | 59 | if not os.path.exists(in_dir): |
| 58 | raise ValueError("Can't load from nonexistent path : %s" % in_dir) | 60 | raise ValueError("Can't load from nonexistent path : %s" % in_dir) |
| 59 | 61 | ||
| @@ -71,10 +73,12 @@ class DirMap(object): | |||
| 71 | stripped = path if path.find(in_dir) else path[len(in_dir):] | 73 | stripped = path if path.find(in_dir) else path[len(in_dir):] |
| 72 | path_arr = stripped.split("/") | 74 | path_arr = stripped.split("/") |
| 73 | 75 | ||
| 74 | self.add_values(path_arr, values) | 76 | dir_map.add_values(path_arr, values) |
| 75 | 77 | ||
| 76 | read2(in_dir) | 78 | read2(in_dir) |
| 77 | 79 | ||
| 80 | return dir_map | ||
| 81 | |||
| 78 | def __str__(self): | 82 | def __str__(self): |
| 79 | def str2(node, level): | 83 | def str2(node, level): |
| 80 | header = " " * level | 84 | header = " " * level |
