Changeset 200 for test


Ignore:
Timestamp:
06/03/10 01:08:20 (15 years ago)
Author:
tim
Message:

redesigned python key iterator and test script
updated documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/pyregfi-smoketest.py

    r199 r200  
    1515
    1616
    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 
    3417for f in files:
    3518    rf = pyregfi.RegistryFile(f)
    3619    iter = rf.get_key()
    37     print walk_tree(iter)
     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.keyname
     26        num_keys +=1
     27        num_values += iter_values(iter)
     28
     29    print "keys: %d" % num_keys
     30    print "values: %d" % num_values
Note: See TracChangeset for help on using the changeset viewer.