Last change
on this file since 199 was
199,
checked in by tim, 15 years ago
|
reworked part of regfi C API to make python wrappers simpler
continued work on python wrappers
fixed some issues in pyregfi-smoketest. WIP
|
-
Property svn:executable set to
*
|
File size:
664 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | import sys |
---|
4 | import pyregfi |
---|
5 | |
---|
6 | files = sys.argv[1:] |
---|
7 | |
---|
8 | |
---|
9 | def iter_values(iter): |
---|
10 | i = 0 |
---|
11 | for value in iter.list_values(): |
---|
12 | i += 1 |
---|
13 | |
---|
14 | return i |
---|
15 | |
---|
16 | |
---|
17 | def walk_tree(iter): |
---|
18 | total_keys = 1 |
---|
19 | total_values = iter_values(iter) |
---|
20 | print "total_values:", total_values |
---|
21 | |
---|
22 | for sub_key in iter: |
---|
23 | print sub_key.keyname |
---|
24 | |
---|
25 | print iter.down() |
---|
26 | num_keys,num_values = walk_tree(iter) |
---|
27 | total_keys += num_keys |
---|
28 | total_values += num_values |
---|
29 | iter.up() |
---|
30 | |
---|
31 | return (total_keys, total_values) |
---|
32 | |
---|
33 | |
---|
34 | for f in files: |
---|
35 | rf = pyregfi.RegistryFile(f) |
---|
36 | iter = rf.get_key() |
---|
37 | print walk_tree(iter) |
---|
Note: See
TracBrowser
for help on using the repository browser.