commit-gnue
[Top][All Lists]
Advanced

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

gnue gnue-common/doc/GCommSpecifications.txt gn...


From: Jason Cater
Subject: gnue gnue-common/doc/GCommSpecifications.txt gn...
Date: Tue, 30 Oct 2001 01:13:21 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/10/30 01:13:21

Modified files:
        gnue-common/doc: GCommSpecifications.txt 
        gnue-common/src: GComm.py 
        gnue-common/src/commdrivers: GCommBase.py 
        gnue-common/src/commdrivers/_helpers: AsyncHTTPServer.py 
        gnue-common/src/commdrivers/xmlrpc: CommDriver.py 
        reports/src    : GRServices.py 
Added files:
        gnue-common/src/commdrivers/proxy: CommDriver.py __init__.py 

Log message:
        synching machines

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/doc/GCommSpecifications.txt.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GComm.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/commdrivers/GCommBase.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/commdrivers/_helpers/AsyncHTTPServer.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/commdrivers/proxy/CommDriver.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/commdrivers/proxy/__init__.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/commdrivers/xmlrpc/CommDriver.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRServices.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/gnue-common/doc/GCommSpecifications.txt
diff -u gnue/gnue-common/doc/GCommSpecifications.txt:1.5 
gnue/gnue-common/doc/GCommSpecifications.txt:1.6
--- gnue/gnue-common/doc/GCommSpecifications.txt:1.5    Fri Oct 26 01:40:45 2001
+++ gnue/gnue-common/doc/GCommSpecifications.txt        Tue Oct 30 01:13:20 2001
@@ -102,7 +102,7 @@
    Python server handlers can use standard Python exceptions to
    signal errors.  The GComm adapters will translate these to
    whatever error mechanism that adapter provides.  Should the
-   adapter provide named exceptions, then 
+   adapter provide named exceptions, then
 
 
 
@@ -126,5 +126,22 @@
 
 
 
+Typical sequence of events
+==========================
 
+Client program needs to use services on Server X
+As specified by the end-user in its configuration file,
+it will use the XML-RPC adapter.
 
+The client program gets a GComm interface instance
+by calling GComm
+
+  params = { 'host': 'myserver.mydomain',
+             'port': 8765,
+             'protocol': 'https' }
+
+  server = GComm.attach('xmlrpc', params)
+
+  Reports = server.requestService('Reports')
+
+  server.Reports.
Index: gnue/gnue-common/src/GComm.py
diff -u gnue/gnue-common/src/GComm.py:1.2 gnue/gnue-common/src/GComm.py:1.3
--- gnue/gnue-common/src/GComm.py:1.2   Thu Oct 25 19:00:19 2001
+++ gnue/gnue-common/src/GComm.py       Tue Oct 30 01:13:20 2001
@@ -1,9 +1,9 @@
 #
 # This file is part of GNU Enterprise.
 #
-# GNU Enterprise is free software; you can redistribute it 
-# and/or modify it under the terms of the GNU General Public 
-# License as published by the Free Software Foundation; either 
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
 # version 2, or (at your option) any later version.
 #
 # GNU Enterprise is distributed in the hope that it will be
@@ -27,7 +27,37 @@
 # NOTES:
 #
 
-class GComm: 
+class GComm:
   pass
 
+
+#
+# Exception hierarchy:
+#
+# Error
+# |__ ProgrammingError
+# |   |__ InvalidService
+# |__ CommunicationsError
+# |__ UserError (base for user-defined errors)
+#
+
+class Error (StandardError):
+  pass
+
+class ProgrammingError (Error):
+  pass
+
+class InvalidService (ProgrammingError):
+  pass
+
+class CommunicationsError(Error)
+  pass
+
+class UserError(Error)
+  pass
+
+
+
+class UserError(Error)
+  pass
 
Index: gnue/gnue-common/src/commdrivers/GCommBase.py
diff -u gnue/gnue-common/src/commdrivers/GCommBase.py:1.3 
gnue/gnue-common/src/commdrivers/GCommBase.py:1.4
--- gnue/gnue-common/src/commdrivers/GCommBase.py:1.3   Fri Oct 26 01:40:45 2001
+++ gnue/gnue-common/src/commdrivers/GCommBase.py       Tue Oct 30 01:13:20 2001
@@ -1,9 +1,9 @@
 #
 # This file is part of GNU Enterprise.
 #
-# GNU Enterprise is free software; you can redistribute it 
-# and/or modify it under the terms of the GNU General Public 
-# License as published by the Free Software Foundation; either 
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
 # version 2, or (at your option) any later version.
 #
 # GNU Enterprise is distributed in the hope that it will be
@@ -27,16 +27,23 @@
 # NOTES:
 #
 
+from gnue.common import GComm
+
 class Client:
-  pass
+  def runService(self, method, data):
+    pass
 
 
 class Server:
-  def raiseException(self, exception, message)
+  def runService(self, method, data):
+    pass
+
+  def raiseException(self, exception, message):
     raise exception, message
 
 
-class GCommException (StandardError):
-  pass
+class ProxyObject:
+  def __init__(self, client):
+    self._client = client
 
 
Index: gnue/gnue-common/src/commdrivers/_helpers/AsyncHTTPServer.py
diff -u gnue/gnue-common/src/commdrivers/_helpers/AsyncHTTPServer.py:1.2 
gnue/gnue-common/src/commdrivers/_helpers/AsyncHTTPServer.py:1.3
--- gnue/gnue-common/src/commdrivers/_helpers/AsyncHTTPServer.py:1.2    Fri Oct 
26 01:40:45 2001
+++ gnue/gnue-common/src/commdrivers/_helpers/AsyncHTTPServer.py        Tue Oct 
30 01:13:21 2001
@@ -28,6 +28,11 @@
 
 from gnue.common.commdrivers import GCommBase
 
+import asyncore
+
 class AsyncHTTPServer(GCommBase.Server):
-  pass
+  def __init__(self):
+    GCommBase.Server.__init__(self)
+
+
 
Index: gnue/gnue-common/src/commdrivers/xmlrpc/CommDriver.py
diff -u gnue/gnue-common/src/commdrivers/xmlrpc/CommDriver.py:1.2 
gnue/gnue-common/src/commdrivers/xmlrpc/CommDriver.py:1.3
--- gnue/gnue-common/src/commdrivers/xmlrpc/CommDriver.py:1.2   Fri Oct 26 
01:40:45 2001
+++ gnue/gnue-common/src/commdrivers/xmlrpc/CommDriver.py       Tue Oct 30 
01:13:21 2001
@@ -1,9 +1,9 @@
 #
 # This file is part of GNU Enterprise.
 #
-# GNU Enterprise is free software; you can redistribute it 
+# GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either 
+# License as published by the Free Software Foundation; either
 # version 2, or (at your option) any later version.
 #
 # GNU Enterprise is distributed in the hope that it will be
@@ -29,7 +29,7 @@
 
 
 #
-# We provide both a client and a server driver
+# We provide both a client and a server driver...
 #
 CLIENT = 1      # ClientAdapter
 SERVER = 1      # ServerAdapter
@@ -39,7 +39,7 @@
 import string
 
 try:
-  import xmlrpclib, xmlrpcserver
+  import xmlrpclib
 except ImportError:
   print "\nUnable to load xmlrpclib.  To use the XML-RPC interface, \n"
         "please install xmlrpc from:\n"
@@ -48,27 +48,28 @@
 
 
 #
+# ClientAdapter
 #
-#
 class ClientAdapter(GCommBase.Client):
+  pass
 
-#
 #
+# ServerAdapter
 #
 class ServerAdapter(AsyncHTTPServer):
 
   def raiseException(self, exception, message, event=None)
-    raise exception, message
+    xmlrpclib.dumps(xmlrpclib.Fault(34543, '%s: %s' % (exception, message)))
 
-#
 #
+# ProxyObject
 #
 class ProxyObject(GCommBase.ProxyObject):
 
   # Server raised an exception...
   # Translate the exception into a local python
   # exception and raise it...
-  def _raiseException(self, data)
+  def _exceptionRaised(self, data)
     if data.isGNUeGenerated():
       name, text = string.split(data.message,': ',1)
       # TODO: _lookup???
Index: gnue/reports/src/GRServices.py
diff -u gnue/reports/src/GRServices.py:1.2 gnue/reports/src/GRServices.py:1.3
--- gnue/reports/src/GRServices.py:1.2  Fri Oct 26 01:40:45 2001
+++ gnue/reports/src/GRServices.py      Tue Oct 30 01:13:21 2001
@@ -27,6 +27,13 @@
 # NOTES:
 #
 
+string
+boolean
+set
+binary
+float
+integer
+datetime
 
 
 ExportedServices = (
@@ -37,18 +44,22 @@
             'Parameters': (
                 'location': {
                     'Description': 'The location of the report',
-                    'Typecast': GTypecast.text } ),
-            'Returns': GTypecast.text,
+                    'Typecast': 'string' } ),
+            'Returns': 'binary',
             'Description' : 'Returns the report definition (in XML format).' },
        'getReportHeader': {
             'Parameters': (
                 'location': {
                     'Description': 'The location of the report',
-                    'Typecast': GTypecast.text } ),
-            'Typecast': GTypecast.text,
+                    'Typecast': 'string' } ),
+            'Returns': 'binary',
             'Description' : 'Returns the report definition (in XML format).' },
-    }
-    'Exceptions':  {
+       'getAvailableFilters': {
+            'Parameters': (),
+            'Typecast': 'list:string',
+            'Description' : 'Returns the report definition (in XML format).' },
+    },
+    'Exceptions': {
        'ReportNotFound' : {
             'Description': ''}
         }



reply via email to

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