commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/common/src/commdrivers _parser/Objects.py ...


From: Jason Cater
Subject: gnue/common/src/commdrivers _parser/Objects.py ...
Date: Tue, 18 Dec 2001 23:05:46 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/12/18 23:05:45

Modified files:
        common/src/commdrivers/_parser: Objects.py 
        common/src/commdrivers/xmlrpc: DebugSocketServer.py 
                                       ServerAdapter.py 

Log message:
        syncing machines

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/commdrivers/_parser/Objects.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/commdrivers/xmlrpc/DebugSocketServer.py.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/common/src/commdrivers/_parser/Objects.py
diff -c gnue/common/src/commdrivers/_parser/Objects.py:1.3 
gnue/common/src/commdrivers/_parser/Objects.py:1.4
*** gnue/common/src/commdrivers/_parser/Objects.py:1.3  Tue Dec 18 01:48:42 2001
--- gnue/common/src/commdrivers/_parser/Objects.py      Tue Dec 18 23:05:45 2001
***************
*** 45,56 ****
--- 45,58 ----
  class RpcMethod (GObj):
    def __init__(self, parent=None):
      GObj.__init__(self, parent, type="RpMethod")
+     self._arguments = []
  
  
  # argument object
  class RpcArgument (GObj):
    def __init__(self, parent=None):
      GObj.__init__(self, parent, type="RpArgument")
+     parent._arguments.append(self)
  
  
  # attribute object
Index: gnue/common/src/commdrivers/xmlrpc/DebugSocketServer.py
diff -c gnue/common/src/commdrivers/xmlrpc/DebugSocketServer.py:1.1 
gnue/common/src/commdrivers/xmlrpc/DebugSocketServer.py:1.2
*** gnue/common/src/commdrivers/xmlrpc/DebugSocketServer.py:1.1 Tue Dec 18 
14:52:20 2001
--- gnue/common/src/commdrivers/xmlrpc/DebugSocketServer.py     Tue Dec 18 
23:05:45 2001
***************
*** 46,52 ****
      try:
        self._port = params['port']
      except KeyError:
!       raise GComm.AdapterConfigurationError, 
  
      self._tcpserver = SocketServer.TCPServer(('',self._port),
            DebugRequestHandler)
--- 46,52 ----
      try:
        self._port = params['port']
      except KeyError:
!       raise GComm.AdapterConfigurationError,'Required parameter "port" not 
supplied'
  
      self._tcpserver = SocketServer.TCPServer(('',self._port),
            DebugRequestHandler)
***************
*** 54,60 ****
  
  
    def serve(self):
!     self.
  
  
  
--- 54,61 ----
  
  
    def serve(self):
! #    self.
!     pass
  
  
  
***************
*** 65,71 ****
  
  
  
! class DebugRequestHandler(xmlrpcserver.RequestHandler)
  
  
  
--- 66,73 ----
  
  
  
! class DebugRequestHandler(xmlrpcserver.RequestHandler):
!   pass
  
  
  
Index: gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py
diff -c gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.2 
gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.3
*** gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.2     Tue Dec 18 
01:48:43 2001
--- gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py Tue Dec 18 23:05:45 2001
***************
*** 41,47 ****
  SERVER = 1      # ServerAdapter
  
  
! from gnue.common.commdrivers._helpers.AsyncSocketServer import AsyncHTTPServer
  from gnue.common.commdrivers._helpers import ObjectLibrarian
  
  from gnue.common.commdrivers import GCommBase
--- 41,48 ----
  SERVER = 1      # ServerAdapter
  
  
! #from gnue.common.commdrivers._helpers.AsyncSocketServer import 
AsyncHTTPServer
! from DebugSocketServer import HTTPServer
  from gnue.common.commdrivers._helpers import ObjectLibrarian
  
  from gnue.common.commdrivers import GCommBase
***************
*** 59,64 ****
--- 60,77 ----
  
  
  
+ # Mapping from GRPC's datatype to XML-RPC datatypes
+ _datatypeMap = {
+   'integer': 'int',
+   'string': 'string',
+   'boolean': 'boolean',
+   'date': 'dateTime.iso8601',
+   'number': 'double',
+   'base64': 'base64',
+   'binary': 'base64'
+ }
+ 
+ 
  ##############################################################################
  #
  # ServerAdapter
***************
*** 66,72 ****
  class ServerAdapter(HTTPServer):
  
    def __init__(self, rpcdef, bindings, params):
!     HTTPServer.__init__(self, rpcdef, bindings, params)
  
  
      self.directory = {
--- 79,85 ----
  class ServerAdapter(HTTPServer):
  
    def __init__(self, rpcdef, bindings, params):
!     HTTPServer.__init__(self, params)
  
  
      self.directory = {
***************
*** 89,94 ****
--- 102,109 ----
      # Create our internal "service directory"
      self._xmlrpc_mapObjects(rpcdef)
  
+     print self.directory
+ 
  
    #
    # Create an internal "service directory"
***************
*** 97,113 ****
  
      # For servicable objects, maintain a complete "path" for reference
      if object._type in ('RpService','RpMethod','RpObject'):
!       if parent:
          object._xmlrpc__path = "%s.%s" % (parent._xmlrpc__path, object.name)
        else:
          object._xmlrpc__path = object.name
  
      # Add all methods to our directory
      if object._type == 'RpMethod':
!       self.directory[object._xmlrpc__path] =
!         { 'signature': None,  # TODO
            'help': '',         # TODO
            'binding': None   } # TODO
  
      # Now, map our children
      for child in object._children:
--- 112,164 ----
  
      # For servicable objects, maintain a complete "path" for reference
      if object._type in ('RpService','RpMethod','RpObject'):
!       if parent and hasattr(parent,'_xmlrpc__path'):
          object._xmlrpc__path = "%s.%s" % (parent._xmlrpc__path, object.name)
        else:
          object._xmlrpc__path = object.name
  
+ 
+ 
      # Add all methods to our directory
      if object._type == 'RpMethod':
! 
!       # Build the signature list...
!       signature = []
! 
!       # The first element is the return type (can be None)
!       if hasattr(object,'type') and len(object.type):
!         signature.append(_datatypeMap[object.type])
!       else:
!         signature.append(None)
! 
!       # Then add the argument datatypes...
!       for arg in object._arguments:
!         signature.append(_datatypeMap[arg.type])
! 
! 
!       # Add the directory entry
!       self.directory[object._xmlrpc__path] = \
!         { 'signature': tuple(signature),
            'help': '',         # TODO
            'binding': None   } # TODO
+ 
+ 
+     # Add all methods to our directory
+     if object._type == 'RpAttribute':
+ 
+       # Add the directory entry
+       self.directory['%s.get_%s' % (parent._xmlrpc__path, object.name)] = \
+         { 'signature': (object.type,),
+           'help': '',         # TODO
+           'binding': None   } # TODO
+ 
+       # Add the directory entry
+       self.directory['%s.set_%s' % (parent._xmlrpc__path, object.name)] = \
+         { 'signature': (None, object.type),
+           'help': '',         # TODO
+           'binding': None   } # TODO
+ 
+ 
  
      # Now, map our children
      for child in object._children:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]