Пример #1
0
class OSSAssembly:
    def __init__ ( self ):
        self.handler_factory = handler.OSSHandlerFactory ( )
        self.parser_factory  = SaxParserFactory ( )

    def load_buckets ( self, response ):
        parser = self.parser_factory.create ( )
        handler = self.handler_factory.createBucketHandler ( )
        parser.setContentHandler ( handler )
        parser.parse ( response )
        return handler.buckets 


    def load_objects ( self, bucket, response ):
        parser = self.parser_factory.create ( )
        handler = self.handler_factory.createObjectHandler ( bucket )
        parser.setContentHandler ( handler )
        parser.parse ( response )
        return handler.objects
Пример #2
0
	def __init__ ( self ):
		sax_parser_factory = SaxParserFactory ( )
		self.parser = sax_parser_factory.create ( )
		self.fixtures = FIXTUES_DIR
Пример #3
0
 def __init__ ( self ):
     self.handler_factory = handler.OSSHandlerFactory ( )
     self.parser_factory  = SaxParserFactory ( )
Пример #4
0
 def __init__(self):
     sax_parser_factory = SaxParserFactory()
     self.parser = sax_parser_factory.create()
     self.fixtures = FIXTUES_DIR