source: test/pyregfi-smoketest.py @ 211

Last change on this file since 211 was 209, checked in by tim, 14 years ago

worked on pyregfi value data interface

added initial scons target for API/devel documentation

  • Property svn:executable set to *
File size: 725 bytes
Line 
1#!/usr/bin/env python
2
3import sys
4import pyregfi
5
6files = sys.argv[1:]
7
8
9def iter_values(key):
10    i = 0
11    for value in key.values():
12        i += 1
13       
14    return i
15
16
17for f in files:
18    rf = pyregfi.RegistryFile(f)
19    iter = rf.TreeIterator()
20
21    num_keys = 0
22    num_values = 0
23    # The iterator now walks the entire registry hive, depth-first
24    for key in iter:
25        #print key.key.keyname
26        num_keys +=1
27        num_values += iter_values(key)
28
29    print "keys: %d" % num_keys
30    print "values: %d" % num_values
31
32
33iter = rf.TreeIterator()
34root = iter.current()
35for key in root.subkeys():
36    for subkey in key.subkeys():
37        for subsubkey in subkey.subkeys():
38            print key.key.keyname
39
Note: See TracBrowser for help on using the repository browser.