File: command_node_inspector.python

package info (click to toggle)
k3d 0.4.3.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 51,716 kB
  • ctags: 81,610
  • sloc: cpp: 283,698; ansic: 64,095; xml: 61,533; sh: 9,026; makefile: 5,282; python: 431; perl: 308; awk: 130
file content (44 lines) | stat: -rw-r--r-- 959 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#python


def ListProperties(Node, Level, Name):

	indent = ""

	for j in range(Level):
		indent = indent + "\t"

	print "PROCESSING ", Name

	if Node.Children():
		for i in Node.Children():
			print indent, " child (", Name, ") : ", i
			ListProperties(Node.GetNode(i), Level + 1, i)

	#for i in Node.Children():
	#	print indent, " child : ", i
	#	if i == "document":
	#		print "OK!"
	#		newnode = Node.GetNode(i)
	#		for j in newnode.Children():
	#			print indent, "\t schild : ", j
	#		print indent, "properties: "
	#		for k in newnode.ListProperties():
	#			print indent, "\t prop : ", k.Name()

	#print "Properties : "
	#print "Prop : ", Node.Name()
	#if Node.ListProperties():
	#	for i in Node.ListProperties():
	#		print indent," property : ", i, " = ", Node.GetProperty(i)
	#for i in Node.Properties():
	#	print indent," property : ", i.Name()



# Main
mainnode = Application.CommandNode("/application")
ListProperties(mainnode, 0, "application")