Example #1
0
    def load(self, fh, paranoia=None):
        "Load pickled object from file fh."
        # If paranoia is None, getParanoia() is used.
        global visited
        if paranoia is None: paranoia = getParanoia()

        # read from a file,compressed file,string,or compressed string
        fh = StreamReader(fh)

        visited = {}

        parser = enumParsers().get(getParser())
        if parser:
            return parser(fh, paranoia=paranoia)
        else:
            raise XMLUnpicklingError, "Unknown parser %s" % getParser()
Example #2
0
    def load(self, fh, paranoia=None):
        "Load pickled object from file fh."
        # If paranoia is None, getParanoia() is used.
        global visited
        if paranoia is None: paranoia=getParanoia()

        # read from a file,compressed file,string,or compressed string
        fh = StreamReader(fh)

        visited = {}

        parser = enumParsers().get(getParser())
        if parser:
            return parser(fh, paranoia=paranoia)
        else:
            raise XMLUnpicklingError, "Unknown parser %s" % getParser()
Example #3
0
            sys.exit(1)

    print "***************** INGORE EXCEPTIONS BETWEEN THESE LINES *****************"
    
    unlink('harness_check.out')

import gnosis.version
pechof(tout,"*** Running all xml.pickle tests, Gnosis Utils %s" % \
       gnosis.version.VSTRING)

# check test harness
check_harness()
pechof(tout,"Sanity check: OK")
      
# get available parsers
parser_dict = enumParsers()

# test with DOM parser, if available
if parser_dict.has_key('DOM'):

    # make sure the USE_.. files are gone
    unlink("USE_SAX")
    unlink("USE_CEXPAT")

    t1 = time()

    for test in tests:
        print "Running %s" % test
        echof(tout,"** %s %s DOM PARSER **" % (py,test))
        r = os.system("%s %s >> %s"%(py,test,tout))
        if r != 0: