diff options
author | martin.von.loewis <devnull@localhost> | 2007-07-08 02:53:53 +0000 |
---|---|---|
committer | martin.von.loewis <devnull@localhost> | 2007-07-08 02:53:53 +0000 |
commit | 7c3aa86a80492d753704d4dfe3c6df44948e9412 (patch) | |
tree | 5f59f9149d31a278f577aeefd53ac8ab8f48e6ab /trove.py | |
parent | 2676f1bd171b3453e6edfec7f2b03e1dcee7d6e9 (diff) | |
download | decorator-7c3aa86a80492d753704d4dfe3c6df44948e9412.tar.gz |
Add browse support to the store, add levels.
Diffstat (limited to 'trove.py')
-rw-r--r-- | trove.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -9,6 +9,10 @@ class Node: self.name = name self.path = path self.path_split = path_split + if path_split: + self.level = len(path_split) + else: + self.level = 1 def __repr__(self): return '<Node %d %s>'%(self.id, self.name) @@ -18,12 +22,12 @@ class Node: for node in self.arcs.values(): result.extend(node.subtree_ids()) return result - + class Trove: def __init__(self, cursor): self.root = Node() self.trove = {} - cursor.execute('select * from trove_classifiers order by classifier') + cursor.execute('select id,classifier from trove_classifiers order by classifier') # now generate the tree for id, line in cursor.fetchall(): |