- Timestamp:
- 03/30/11 11:17:26 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/pyregfi/__init__.py
r217 r218 322 322 323 323 def get_parent(self): 324 if self.is_root(): 325 return None 324 326 parent_base = regfi.regfi_get_parentkey(self._hive.file, self._base) 325 327 if parent_base: 326 328 return Key(self._hive, parent_base) 327 328 329 return None 329 330 330 331 def is_root(self): 331 return (self._hive. get_root()== self)332 return (self._hive.root == self) 332 333 333 334 … … 408 409 file = None 409 410 raw_file = None 410 411 _root = None 412 411 413 def __init__(self, fh): 412 414 # The fileno method may not exist, or it may throw an exception … … 426 428 427 429 def __getattr__(self, name): 430 if name == "root": 431 if self._root == None: 432 self._root = Key(self, regfi.regfi_get_rootkey(self.file)) 433 return self._root 434 428 435 return getattr(self.file.contents, name) 429 436 … … 435 442 def __iter__(self): 436 443 return HiveIterator(self) 437 438 def get_root(self):439 return Key(self, regfi.regfi_get_rootkey(self.file))440 444 441 445
Note: See TracChangeset
for help on using the changeset viewer.