Ignore:
Timestamp:
04/05/11 11:17:41 (13 years ago)
Author:
tim
Message:

added test case for python callback read/seek
began adding windows support in pyregfi
improved win32 build target

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/pyregfi/__init__.py

    r224 r225  
    9595import sys
    9696import time
    97 import weakref
    9897from pyregfi.structures import *
    9998
     
    635634            pass
    636635       
     636        fh.seek(0)
    637637        self.raw_file = structures.REGFI_RAW_FILE()
    638638        self.raw_file.fh = fh
    639639        self.raw_file.seek = seek_cb_type(self.raw_file.cb_seek)
    640640        self.raw_file.read = read_cb_type(self.raw_file.cb_read)
    641         self.file = regfi.regfi_alloc_cb(self.raw_file, REGFI_ENCODING_UTF8)
    642 
     641        self.file = regfi.regfi_alloc_cb(pointer(self.raw_file), REGFI_ENCODING_UTF8)
     642        if not self.file:
     643            # XXX: switch to non-generic exception
     644            raise Exception("Could not open registry file.  Current log:\n"
     645                            + GetLogMessages())
    643646
    644647    def __getattr__(self, name):
Note: See TracChangeset for help on using the changeset viewer.