473,800 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generating a tree-like structure

Hi,

This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

Any ideas appreciated...
Thorsten
May 31 '07 #1
3 2556
On May 31, 12:44 pm, Thorsten Kampe <thors...@thors tenkampe.dewrot e:
Hi,

This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

Any ideas appreciated...

Thorsten
I think you might be able to use ElementTree. The website for the
module claims it can be used for hierarchical data structures:
http://effbot.org/zone/element-index.htm

Did you look at any of the Python LDAP tools? They might be useful
too. See some of the links below:
http://linuxjournal.com/article/6988
http://aspn.activestate.com/ASPN/Coo.../Recipe/303336

Hopefully they'll give some guidance. I've not used LDAP myself as of
yet.

Mike

May 31 '07 #2
* (31 May 2007 12:15:48 -0700)
On May 31, 12:44 pm, Thorsten Kampe <thors...@thors tenkampe.dewrot e:
This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

I think you might be able to use ElementTree. The website for the
module claims it can be used for hierarchical data structures:
http://effbot.org/zone/element-index.htm

Did you look at any of the Python LDAP tools? They might be useful
too. See some of the links below:
http://linuxjournal.com/article/6988
http://aspn.activestate.com/ASPN/Coo.../Recipe/303336

Hopefully they'll give some guidance. I've not used LDAP myself as of
yet.
I already have the LDAP output part working - with python-ldap under
Cygwin - and I generate HMTL output with markup.py. Pretty simple. But
a tree structure output would be even prettier...
May 31 '07 #3
On 2007-05-31, Thorsten Kampe <th******@thors tenkampe.dewrot e:
* (31 May 2007 12:15:48 -0700)
>On May 31, 12:44 pm, Thorsten Kampe <thors...@thors tenkampe.dewrot e:
This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

I think you might be able to use ElementTree. The website for the
module claims it can be used for hierarchical data structures:
http://effbot.org/zone/element-index.htm

Did you look at any of the Python LDAP tools? They might be useful
too. See some of the links below:
http://linuxjournal.com/article/6988
http://aspn.activestate.com/ASPN/Coo.../Recipe/303336

Hopefully they'll give some guidance. I've not used LDAP myself as of
yet.

I already have the LDAP output part working - with python-ldap under
Cygwin - and I generate HMTL output with markup.py. Pretty simple. But
a tree structure output would be even prettier...
I would probably generate a DOT file to get a 2D visualization. DOT is part of
Graphviz (graphviz.org), and there are quite a few graphviz front-ends
available in Python to make DOT generation easier (pydot, yapgvb, and probably
a few others).

Albert
Jun 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2182
by: Tree menu using XML | last post by:
I have one XML file that has nodes and sub node and each and every node has the attribute call visible if its value is true then diplay this node else don't display thid node, but this condition i am able to check using xpath in asp.net 2.0 till MenuItem node. if i check visible attribute value till SubMenuLevel0 node then in tree it will not display the MenuItem Node at all Note: My tree Menu will start from MenuItem node and it will...
4
9021
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working, even the removal, I just don't know how to keep track of the parent, so that I can set its child to the child of the node to be removed. IE - if I had C / \ B D
2
1637
by: New | last post by:
Why does this code insert a node into a binary search tree correctly? If I only inserting going by first digit it works properly but when I try inserting going by the whole ip and the port number the inserts are totally out of order. where IPAddress is four ints Node is an IPAddress, portNumber, left pointer and right pointer Nodeptr is a pointer to a Node
5
1993
by: Mike | last post by:
Why does this code insert a node into a binary search tree correctly? If I only inserting going by first digit it works properly but when I try inserting going by the whole ip and the port number the inserts are totally out of order. where IPAddress is four ints Node is an IPAddress, portNumber, left pointer and right pointer Nodeptr is a pointer to a Node
5
9190
by: Liz | last post by:
C# .NET creating a tree programmatically treeView1.BeginUpdate(); treeView1.Nodes.Clear(); treeView1.Nodes.Add(new TreeNode("Client Details")); tvSelect.Nodes.Add(new TreeNode("Referrals")); tvSelect.EndUpdate(); Can anyone tell me how I add child nodes to the above tree?
2
3489
by: Kiran | last post by:
Hello all, I am using a tree to display stuff, and it is constantly updated, but what I have noticed is in the lowest level, there is clearly noticable cutoff of the text I place there. The cutoff is existent even if I do not update the text inside the tree constantly. It seems that the text is halfway below where it should line up. I tried placing an image to see if that would correct it, but it does not. The image is perfectly lined up,...
8
5495
by: Craig | last post by:
Hi there, I'm only new to Python so please bear with me. I using ElementTree to generate an XML file that will reference a DTD and an XSL file. The header information I want at the start of the file is as follows: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <!DOCTYPE BobActivityLog SYSTEM "test.dtd">
2
2251
by: Prasad | last post by:
This was our earlier design <Product Inventory Info> <Company> <Make>Computer General</Make> <Model>Wizbang 1900</Model> It was later found that <Product Inventory Infohad spaces in between. It was later decided that it has to be of the following format
4
9802
by: viperman5000 | last post by:
Using for loops, how would you generate a Christmas Tree using *'s. Also, the size depends on the user's input (size). Any help would be greatly appreciated, as my grade depends on it.
2
4279
by: rednarjess | last post by:
Hello every body; When I want to generate the Javadoc for my project, The result is fine at the bigining of the generating init: Generating Javadoc Javadoc execution Loading source file D:\workspace\JavaApplication4\src\javaapplication4\Main.java... Constructing Javadoc information... Standard Doclet version 1.6.0 Building tree for all the packages and classes...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.