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


import pickle
from pythia.pyre.services.TCPSession import TCPSession


class IDDSession(TCPSession):


    class Inventory(TCPSession.Inventory):

        import pythia.pyre.inventory

        marshaller = pythia.pyre.inventory.facility("marshaller", factory=pythia.pyre.idd.pickler)


    def token(self):

        token = self.request(command="token")

        self._info.line("token received:")
        self._info.line("    id: %s" % token.tid)
        self._info.line("    date: %s" % token.date)
        self._info.log("    locator: %s" % token.locator)

        return token


    def __init__(self, name=None):
        if name is None:
            name = "idd-session"

        TCPSession.__init__(self, name)

        self.marshaller = None

        return

        
    def _configure(self):
        TCPSession._configure(self)
        self.marshaller = self.inventory.marshaller
        return


# version
__id__ = "$Id: IDDSession.py,v 1.2 2005/04/28 03:37:16 pythia.pyre Exp $"

# End of file 

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


import pickle
from pythia.pyre.services.TCPSession import TCPSession


class IDDSession(TCPSession):


    class Inventory(TCPSession.Inventory):

        import pythia.pyre.inventory

        marshaller = pythia.pyre.inventory.facility("marshaller", factory=pythia.pyre.idd.pickler)


    def token(self):

        token = self.request(command="token")

        self._info.line("token received:")
        self._info.line("    id: %s" % token.tid)
        self._info.line("    date: %s" % token.date)
        self._info.log("    locator: %s" % token.locator)

        return token


    def __init__(self, name=None):
        if name is None:
            name = "idd-session"

        TCPSession.__init__(self, name)

        self.marshaller = None

        return

        
    def _configure(self):
        TCPSession._configure(self)
        self.marshaller = self.inventory.marshaller
        return


# version
__id__ = "$Id: IDDSession.py,v 1.2 2005/04/28 03:37:16 pythia.pyre Exp $"

# End of file 

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