-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I find two questions in the codes. #59
Comments
Thanks Cryin! You can solve the first problem by leaving the For the second, it is still absent in the library. Please feel free to add and give me a PR. Cheers! |
Yes, you are right,i solve the first problem by store the full url path assignment identifier; The second problem,In order to maintain the integrity of the treellib and can be maintained and upgraded.I write this function in my own code.So I put it up here: def search_url_list(self,host,layers,filetype=''):
self.link_list=[]
for node in self.link_tree.children(self.root_node):
if node.identifier == host:
nodetmp=node
self.foreach_same_layers(nodetmp,layers)
#print x.identifier
#print x.identifier
return self.link_list
def foreach_same_layers(self, node, layers):
if layers == 1:
if node.data.url.strip():
#print 'ret: '+node.identifier
self.link_list.append(node)
return node
ret=''
#self.link_list=[]
for subnode in self.link_tree.children(node.identifier):
ret = self.foreach_same_layers(subnode, layers-1)
return ret use by search_url_list('subhost.host.com',3,None), |
I also looked into that topic some months ago. At the end of the day, the problem is the Tree object. But changing this would break everything. |
Closing due to inactivity - also seems mostly solved? |
When I try to store files and folders info in the tree structure, the file name or folder name assignment identifier, but there may have same files or folders in different paths, i think this may be a problem, at least when try to store folders or URLs in the tree structure.
For example:
Root
|___ home
| |___ dev
| |___ mysql
| |___ python
|___ etc
|___ dev
| |___ mysql
Another problem is that I need to query a depth for a specific number of all nodes of the identifier ,i find that there is no such interface. So I codeing this function myself. I think it is necessary to add this interface, if there is a need I can paste my code.eg:
Root
|___ home
| |___ dev
| |___ mysql
| |___ python
|___ etc
|___ dev
| |___ mysql
give the layer=3,return a list [ dev,mysql]
Finally, I would like to say that your program is very good.
The text was updated successfully, but these errors were encountered: