commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7460 - in trunk/gnue-common/src: definitions formatting/masks lo


From: reinhard
Subject: [gnue] r7460 - in trunk/gnue-common/src: definitions formatting/masks logic logic/adapters rpc rpc/drivers/proxy rpc/drivers/pyro rpc/drivers/soap rpc/drivers/sockets
Date: Fri, 22 Apr 2005 09:53:24 -0500 (CDT)

Author: reinhard
Date: 2005-04-22 09:53:23 -0500 (Fri, 22 Apr 2005)
New Revision: 7460

Modified:
   trunk/gnue-common/src/definitions/GObjects.py
   trunk/gnue-common/src/formatting/masks/test.py
   trunk/gnue-common/src/logic/GTrigger.py
   trunk/gnue-common/src/logic/adapters/ecmascript.py
   trunk/gnue-common/src/logic/language.py
   trunk/gnue-common/src/rpc/client.py
   trunk/gnue-common/src/rpc/drivers/proxy/CommDriver.py
   trunk/gnue-common/src/rpc/drivers/pyro/ClientAdapter.py
   trunk/gnue-common/src/rpc/drivers/pyro/ServerAdapter.py
   trunk/gnue-common/src/rpc/drivers/soap/CommDriver.py
   trunk/gnue-common/src/rpc/drivers/sockets/CommDriver.py
   trunk/gnue-common/src/rpc/server.py
Log:
More fixes for epydoc.


Modified: trunk/gnue-common/src/definitions/GObjects.py
===================================================================
--- trunk/gnue-common/src/definitions/GObjects.py       2005-04-22 09:18:19 UTC 
(rev 7459)
+++ trunk/gnue-common/src/definitions/GObjects.py       2005-04-22 14:53:23 UTC 
(rev 7460)
@@ -190,6 +190,10 @@
     @rtype: string or binary(?)
     @return: The contents of the children 
     """
+
+    # This is down here to avoid recursive importing
+    from gnue.common.definitions.GBinary import GBinary
+
     content = ""
     for child in self._children:
       if isinstance(child, GContent):
@@ -526,6 +530,3 @@
   def getClass(self):
     raise "Virtual method not implemented"
 
-
-# This is down here to avoid recursive importing
-from gnue.common.definitions.GBinary import GBinary

Modified: trunk/gnue-common/src/formatting/masks/test.py
===================================================================
--- trunk/gnue-common/src/formatting/masks/test.py      2005-04-22 09:18:19 UTC 
(rev 7459)
+++ trunk/gnue-common/src/formatting/masks/test.py      2005-04-22 14:53:23 UTC 
(rev 7460)
@@ -19,30 +19,31 @@
 # =============================================================================
 # Test date mask
 # =============================================================================
-m='"Date:" M/D/y'
-mask = InputMask(m)
-print "Mask: %s" % m
-mask.begin()
-for f in ('','1','12','123','1234','12345','9999'):
-  print string.ljust("Input: '%s'" % f, 18),
-  output, cursor = mask._parseInput(newtext='%s'%f)
-  print "Output: " + formatOutput(output, cursor)
+if __name__ == '__main__':
+  m='"Date:" M/D/y'
+  mask = InputMask(m)
+  print "Mask: %s" % m
+  mask.begin()
+  for f in ('','1','12','123','1234','12345','9999'):
+    print string.ljust("Input: '%s'" % f, 18),
+    output, cursor = mask._parseInput(newtext='%s'%f)
+    print "Output: " + formatOutput(output, cursor)
 
 # =============================================================================
 # Test numeric mask
 # =============================================================================
-m='\\$###,##0!.00'
-mask = InputMask(m)
-print "Mask: %s" % m
+  m='\\$###,##0!.00'
+  mask = InputMask(m)
+  print "Mask: %s" % m
 
-for f in ('','1','12','123','1234','12345','9999'):
-  mask.begin()
-  print string.ljust("Input: '%s'" % f, 18),
-  output, cursor = mask._parseInput(newtext='%s'%f)
-  print "Output: " + formatOutput(output, cursor)
+  for f in ('','1','12','123','1234','12345','9999'):
+    mask.begin()
+    print string.ljust("Input: '%s'" % f, 18),
+    output, cursor = mask._parseInput(newtext='%s'%f)
+    print "Output: " + formatOutput(output, cursor)
 
 
-exit
+  exit
 # =============================================================================
 # Test cursor positioning
 # =============================================================================
@@ -55,35 +56,35 @@
 #  ^ Home
 #  v End
 #    Anything else: As is
-t = "9311<<^v"
+  t = "9311<<^v"
 
-output, cursor = mask.begin()
-print "Init: " + formatOutput(output, cursor)
+  output, cursor = mask.begin()
+  print "Init: " + formatOutput(output, cursor)
 
-for c in t:
-  print "-----------"
-  if c == "<":
-    print string.ljust("Left.", 18),
-    output, cursor = mask.moveLeft()
-  elif c == '>':
-    print string.ljust("Right.", 18),
-    output, cursor = mask.moveRight()
-  elif c == '^':
-    print string.ljust("Home.", 18),
-    output, cursor = mask.moveHome()
-  elif c == 'v':
-    print string.ljust("End.", 18),
-    output, cursor = mask.moveEnd()
-  elif c == '{':
-    print string.ljust("Backspace.", 18),
-    output, cursor = mask.backspace()
-  elif c == '}':
-    print string.ljust("Delete.", 18),
-    output, cursor = mask.delete()
-  else:
-    print string.ljust("Type char %s" % c, 18),
-    output, cursor = mask.add(c)
+  for c in t:
+    print "-----------"
+    if c == "<":
+      print string.ljust("Left.", 18),
+      output, cursor = mask.moveLeft()
+    elif c == '>':
+      print string.ljust("Right.", 18),
+      output, cursor = mask.moveRight()
+    elif c == '^':
+      print string.ljust("Home.", 18),
+      output, cursor = mask.moveHome()
+    elif c == 'v':
+      print string.ljust("End.", 18),
+      output, cursor = mask.moveEnd()
+    elif c == '{':
+      print string.ljust("Backspace.", 18),
+      output, cursor = mask.backspace()
+    elif c == '}':
+      print string.ljust("Delete.", 18),
+      output, cursor = mask.delete()
+    else:
+      print string.ljust("Type char %s" % c, 18),
+      output, cursor = mask.add(c)
 
-  print "Output: " + formatOutput(output, cursor)
+    print "Output: " + formatOutput(output, cursor)
 
 

Modified: trunk/gnue-common/src/logic/GTrigger.py
===================================================================
--- trunk/gnue-common/src/logic/GTrigger.py     2005-04-22 09:18:19 UTC (rev 
7459)
+++ trunk/gnue-common/src/logic/GTrigger.py     2005-04-22 14:53:23 UTC (rev 
7460)
@@ -188,8 +188,8 @@
   # dumpXML
   #
   #
-  def dumpXML(self, lookupDict, treeDump=None, gap=None,
-              textEncoding='<locale>',xmlnamespaces={}, stripPrefixes = None):
+  def dumpXML(self, lookupDict, treeDump=None, gap=None, xmlnamespaces={},
+              textEncoding='<locale>', stripPrefixes=None):
     """
     Dumps an XML representation of a trigger.
     used in saving.

Modified: trunk/gnue-common/src/logic/adapters/ecmascript.py
===================================================================
--- trunk/gnue-common/src/logic/adapters/ecmascript.py  2005-04-22 09:18:19 UTC 
(rev 7459)
+++ trunk/gnue-common/src/logic/adapters/ecmascript.py  2005-04-22 14:53:23 UTC 
(rev 7460)
@@ -37,16 +37,16 @@
 from gnue.common.logic.adapters import Base
 from gnue.common.logic.NamespaceCore import NamespaceElement
 
-try:
-  from spidermonkey import Runtime
-except:
-  print 'Spidermonkey python module not installed!'
-  print 'You can get it from 
http://wwwsearch.sourceforge.net/python-spidermonkey/!'
-  sys.exit(0)
-
 class LanguageAdapter(Base.BaseLanguageAdapter):
   def __init__(self):
-    self._rt = Runtime()
+    # Import down here so module remains importable (for eypdoc)
+    try:
+      import spidermonkey
+    except ImportError:
+      raise errors.AdminError (
+          "Spidermonkey python module not installed!\n"
+          "http://wwwsearch.sourceforge.net/python-spidermonkey/";)
+    self._rt = spidermonkey.Runtime()
     
   def createNewContext(self):
     return ExecutionContext(self._rt)

Modified: trunk/gnue-common/src/logic/language.py
===================================================================
--- trunk/gnue-common/src/logic/language.py     2005-04-22 09:18:19 UTC (rev 
7459)
+++ trunk/gnue-common/src/logic/language.py     2005-04-22 14:53:23 UTC (rev 
7460)
@@ -32,12 +32,6 @@
 # Exceptions
 # =============================================================================
 
-# ---------------------------------------------------------------------------
-# The basis of all language errors
-# ---------------------------------------------------------------------------
-class Error (gException):
-  pass
-
 # -----------------------------------------------------------------------------
 # Python module not available
 # -----------------------------------------------------------------------------

Modified: trunk/gnue-common/src/rpc/client.py
===================================================================
--- trunk/gnue-common/src/rpc/client.py 2005-04-22 09:18:19 UTC (rev 7459)
+++ trunk/gnue-common/src/rpc/client.py 2005-04-22 14:53:23 UTC (rev 7460)
@@ -42,13 +42,6 @@
 # =============================================================================
 
 # -----------------------------------------------------------------------------
-# The basis of all rpc.client exceptions
-# -----------------------------------------------------------------------------
-
-class Error (gException):
-  pass
-
-# -----------------------------------------------------------------------------
 # Requested adapter does not exist
 # -----------------------------------------------------------------------------
 

Modified: trunk/gnue-common/src/rpc/drivers/proxy/CommDriver.py
===================================================================
--- trunk/gnue-common/src/rpc/drivers/proxy/CommDriver.py       2005-04-22 
09:18:19 UTC (rev 7459)
+++ trunk/gnue-common/src/rpc/drivers/proxy/CommDriver.py       2005-04-22 
14:53:23 UTC (rev 7460)
@@ -41,7 +41,7 @@
 SERVER = 1      # ServerAdapter
 
 
-from gnue.common.rpc.drivers import GCommBase
+from gnue.common.rpc.drivers import Base
 from gnue.common.rpc import GComm
 
 import string, sys
@@ -50,7 +50,7 @@
 #
 # ClientAdapter
 #
-class ClientAdapter(GCommBase.Client):
+class ClientAdapter(Base.Client):
 
   def __init__(self, params):
     #print "Proxy Client Adapter created"
@@ -73,11 +73,11 @@
 #
 # ServerAdapter
 #
-class ServerAdapter(GCommBase.Server):
+class ServerAdapter(Base.Server):
 
   def __init__(self, rpcdef, bindings, params):
     #print "Proxy Server Adapter created"
-    GCommBase.Server.__init__(self, rpcdef, bindings, params)
+    Base.Server.__init__(self, rpcdef, bindings, params)
 
   def raiseException(self, exception, message, event=None):
     raise exception, message
@@ -89,9 +89,9 @@
 #
 # ProxyObject
 #
-class _ProxyObject(GCommBase.ProxyObject):
+class _ProxyObject(Base.ProxyObject):
   def __init__(self, adapter, attr, parent=None, **params):
-    GCommBase.ProxyObject.__init__(self, adapter, attr, parent=None, **params)
+    Base.ProxyObject.__init__(self, adapter, attr, parent=None, **params)
 
 
   # Server raised an exception...

Modified: trunk/gnue-common/src/rpc/drivers/pyro/ClientAdapter.py
===================================================================
--- trunk/gnue-common/src/rpc/drivers/pyro/ClientAdapter.py     2005-04-22 
09:18:19 UTC (rev 7459)
+++ trunk/gnue-common/src/rpc/drivers/pyro/ClientAdapter.py     2005-04-22 
14:53:23 UTC (rev 7460)
@@ -44,15 +44,16 @@
 
 import string, sys
 
-try:
-  import Pyro.naming, Pyro.core, Pyro.protocol
+def __initplugin__ ():
+  try:
+    import Pyro.naming, Pyro.core, Pyro.protocol
   
-except ImportError:
-  tmsg = _("\nUnable to load pyro. To use the Pyro interface, \n"
-           "please install xmlrpc from:\n"
-           "    http://sourceforge.net/projects/pyro "
-           "the appropriate DEBIAN package is python-pyro.deb")
-  raise GComm.AdapterInitializationError, tmsg
+  except ImportError:
+    tmsg = _("\nUnable to load pyro. To use the Pyro interface, \n"
+             "please install xmlrpc from:\n"
+             "    http://sourceforge.net/projects/pyro "
+             "the appropriate DEBIAN package is python-pyro.deb")
+    raise GComm.AdapterInitializationError, tmsg
 
 
 ##############################################################################

Modified: trunk/gnue-common/src/rpc/drivers/pyro/ServerAdapter.py
===================================================================
--- trunk/gnue-common/src/rpc/drivers/pyro/ServerAdapter.py     2005-04-22 
09:18:19 UTC (rev 7459)
+++ trunk/gnue-common/src/rpc/drivers/pyro/ServerAdapter.py     2005-04-22 
14:53:23 UTC (rev 7460)
@@ -40,16 +40,17 @@
 
 import string, sys, os, posixpath, urllib, socket
 
-try:
-  import Pyro.naming
-  import Pyro.core
-  from Pyro.protocol import getHostname
-  from Pyro.errors import PyroError,NamingError
+def __initplugin__ ():
+  try:
+    import Pyro.naming
+    import Pyro.core
+    from Pyro.protocol import getHostname
+    from Pyro.errors import PyroError,NamingError
 
-except ImportError:
-  tmsg = _("\nUnable to load Pyro.  To use the Pyro interface, \n"
-           "please install pyro from:\n    http://pyro.sf.net/";)
-  raise GComm.AdapterInitializationError, tmsg
+  except ImportError:
+    tmsg = _("\nUnable to load Pyro.  To use the Pyro interface, \n"
+             "please install pyro from:\n    http://pyro.sf.net/";)
+    raise GComm.AdapterInitializationError, tmsg
 
 
 # Mapping from GRPC's datatype to XML-RPC datatypes
@@ -466,6 +467,3 @@
       result=1
       
     return result
-
-class RpcServiceProxy (Pyro.core.ObjBase):
-  pass

Modified: trunk/gnue-common/src/rpc/drivers/soap/CommDriver.py
===================================================================
--- trunk/gnue-common/src/rpc/drivers/soap/CommDriver.py        2005-04-22 
09:18:19 UTC (rev 7459)
+++ trunk/gnue-common/src/rpc/drivers/soap/CommDriver.py        2005-04-22 
14:53:23 UTC (rev 7460)
@@ -37,23 +37,24 @@
 SERVER = 1      # ServerDriver
 
 
-from gnue.common.rpc.drivers import GCommBase
+from gnue.common.rpc.drivers import Base
 
-try:
-  import soaplib
-except ImportError:
-  print _("\nUnable to load soaplib. To use the SOAP interface, "
-          "please install soaplib from:\n"
-          "    http://www.pythonware.com/products/soap/\n";)
-  sys.exit()
+def __initplugin__ ():
+  try:
+    import soaplib
+  except ImportError:
+    print _("\nUnable to load soaplib. To use the SOAP interface, "
+            "please install soaplib from:\n"
+            "    http://www.pythonware.com/products/soap/\n";)
+    sys.exit()
 
 
 
-class ClientDriver(GCommBase.BaseClientDriver): 
+class ClientDriver(Base.Client): 
   pass
 
 
-class ServerDriver(GCommBase.BaseServerDriver): 
+class ServerDriver(Base.Server): 
 
   def raiseException(self, exception, message):
     raise exception, message

Modified: trunk/gnue-common/src/rpc/drivers/sockets/CommDriver.py
===================================================================
--- trunk/gnue-common/src/rpc/drivers/sockets/CommDriver.py     2005-04-22 
09:18:19 UTC (rev 7459)
+++ trunk/gnue-common/src/rpc/drivers/sockets/CommDriver.py     2005-04-22 
14:53:23 UTC (rev 7460)
@@ -61,7 +61,7 @@
 from gnue.common.rpc.drivers._helpers.AsyncSocketServer import 
AsyncSocketServer
 from gnue.common.rpc.drivers._helpers import ObjectLibrarian
 
-from gnue.common.rpc.drivers import GCommBase
+from gnue.common.rpc.drivers import Base
 from gnue.common.rpc import GComm
 
 import string
@@ -71,7 +71,7 @@
 #
 # ClientAdapter
 #
-class ClientAdapter(GCommBase.Client):
+class ClientAdapter(Base.Client):
 
   def __init__(self, params):
     try:
@@ -157,7 +157,7 @@
 #
 # ProxyObject
 #
-class _ProxyObject(GCommBase.ProxyObject):
+class _ProxyObject(Base.ProxyObject):
 
   def __getattr__(self, attr):
     self.__dict__[attr] = _ProxyObject(self._server, self, name=attr)

Modified: trunk/gnue-common/src/rpc/server.py
===================================================================
--- trunk/gnue-common/src/rpc/server.py 2005-04-22 09:18:19 UTC (rev 7459)
+++ trunk/gnue-common/src/rpc/server.py 2005-04-22 14:53:23 UTC (rev 7460)
@@ -104,13 +104,6 @@
 # =============================================================================
 
 # -----------------------------------------------------------------------------
-# The basis of all rpc.client exceptions
-# -----------------------------------------------------------------------------
-
-class Error (gException):
-  pass
-
-# -----------------------------------------------------------------------------
 # The requested adapter does not exist...
 # -----------------------------------------------------------------------------
 





reply via email to

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