- Timestamp:
- 05/08/11 13:33:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/pyregfi-smoketest.py
r232 r252 42 42 43 43 44 # helper function44 # walks up parents to obtain path, rather than using downward links like iterator 45 45 def getCurrentPath(key): 46 46 if key == None: … … 71 71 i += 1 72 72 except Exception as e: 73 print("WARNING: Could not de cend to path '%s'.\nError:\n %s\n%s" % (path,e.args,e))73 print("WARNING: Could not descend to path '%s'.\nError:\n %s\n%s" % (path,e.args,e)) 74 74 print(" Successfully tested paths on %d keys." % i) 75 75 … … 162 162 iter = pyregfi.HiveIterator(hive) 163 163 for k in iter: 164 path = getCurrentPath(k)164 path = iter.current_path() 165 165 try: 166 hive_iter = hive.subtree(path )166 hive_iter = hive.subtree(path[1:]) 167 167 sk = hive_iter.first_subkey() 168 168 while sk != None: 169 169 ssk = hive_iter.find_subkey(sk.name) 170 sk_stat += len(ssk.name) 170 if ssk != None: 171 sk_stat += len(ssk.name) 172 else: 173 print("WARNING: ssk was None") 171 174 sk = hive_iter.next_subkey() 172 175 … … 174 177 while v != None: 175 178 vv = hive_iter.find_value(v.name) 176 v_stat += len(vv.name) 179 if vv != None: 180 v_stat += len(vv.name) 181 else: 182 print("WARNING: vv was None") 177 183 v = hive_iter.next_value() 178 184 179 185 except Exception as e: 180 print("WARNING: Could not de cend to path '%s'.\nError:\n %s\n%s" % (path,e.args,e))186 print("WARNING: Could not descend to path '%s'.\nError:\n %s\n%s" % (path[1:],e.args,e)) 181 187 print(" Subkey stat: %f" % sk_stat) 182 188 print(" Value stat: %f" % v_stat)
Note: See TracChangeset
for help on using the changeset viewer.