#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                             <NAME>
#                      California Institute of Technology
#                      (C) 1998-2005  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#


from pythia.pyre.odb.fs.CodecODB import CodecODB


class CodecPML(CodecODB):

    def __init__(self):
        CodecODB.__init__(self, encoding='pml')

        from .Parser import Parser
        self._parser = Parser()

        self.parserFactory = None

        return

    def _createRenderer(self):
        from .Renderer import Renderer
        return Renderer()

    def _decode(self, shelf):
        """lock and then read the contents of the file into the shelf"""

        stream = open(shelf.name, "r")
        document = self._parser.parse(stream, self.parserFactory)
        shelf['blade'] = document
        shelf._frozen = True

        return


# version
__id__ = "$Id: CodecPML.py,v 1.1.1.1 2005/03/08 16:13:56 aivazis Exp $"

# End of file

#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                             <NAME>
#                      California Institute of Technology
#                      (C) 1998-2005  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#


from pythia.pyre.odb.fs.CodecODB import CodecODB


class CodecPML(CodecODB):

    def __init__(self):
        CodecODB.__init__(self, encoding='pml')

        from .Parser import Parser
        self._parser = Parser()

        self.parserFactory = None

        return

    def _createRenderer(self):
        from .Renderer import Renderer
        return Renderer()

    def _decode(self, shelf):
        """lock and then read the contents of the file into the shelf"""

        stream = open(shelf.name, "r")
        document = self._parser.parse(stream, self.parserFactory)
        shelf['blade'] = document
        shelf._frozen = True

        return


# version
__id__ = "$Id: CodecPML.py,v 1.1.1.1 2005/03/08 16:13:56 aivazis Exp $"

# End of file

#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #                             <NAME> #                      California Institute of Technology #                      (C) 1998-2005  All Rights Reserved # # {LicenseText} # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # lock and then read the contents of the file into the shelf # version # End of file