commit-gnue
[Top][All Lists]
Advanced

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

r5260 - in trunk/gnue-appserver/src: . classrep


From: reinhard
Subject: r5260 - in trunk/gnue-appserver/src: . classrep
Date: Mon, 8 Mar 2004 07:38:07 -0600 (CST)

Author: reinhard
Date: 2004-03-08 07:38:06 -0600 (Mon, 08 Mar 2004)
New Revision: 5260

Modified:
   trunk/gnue-appserver/src/classrep/SchemaSupport.py
   trunk/gnue-appserver/src/geasConfiguration.py
   trunk/gnue-appserver/src/geasRpcServer.py
Log:
Fixed some strings to make them better translatable.


Modified: trunk/gnue-appserver/src/classrep/SchemaSupport.py
===================================================================
--- trunk/gnue-appserver/src/classrep/SchemaSupport.py  2004-03-08 10:28:53 UTC 
(rev 5259)
+++ trunk/gnue-appserver/src/classrep/SchemaSupport.py  2004-03-08 13:38:06 UTC 
(rev 5260)
@@ -54,7 +54,7 @@
   EInvalidValue is raised if a value doesn't match it's datatype.
   """
   def __init__ (self, native, text):
-    ESchemaSupport.__init__ (self, "'%s' %s" % (repr (native), text))
+    ESchemaSupport.__init__ (self, text % repr (native))
 
 
 # =============================================================================
@@ -104,9 +104,9 @@
           raise Namespace.EInvalidName (item)
 
     schema = GSSchema()
-    schema.title   = _("Appserver Schema Dump")
-    schema.author  = _("Appserver SchemaSupport")
-    schema.version = _("1.0")
+    schema.title   = "Appserver Schema Dump"
+    schema.author  = "Appserver SchemaSupport"
+    schema.version = "1.0"
 
     gsTables = GSTables (schema)
 
@@ -126,10 +126,10 @@
       dest = open (filename, 'w')
 
     dest.write ('<?xml version="1.0" encoding="UTF-8"?>\n')
-    dest.write (_('<!-- Schema definition created by GNUe Appserver\'s ' + \
-                  'Schema Support. -->\n'))
-    dest.write (_("<!-- run this file through gnue-schema to create SQL " + \
-                  "scripts -->\n"))
+    dest.write ('<!-- Schema definition created by GNUe Appserver\'s ' + \
+                'Schema Support. -->\n')
+    dest.write ("<!-- run this file through gnue-schema to create SQL " + \
+                "scripts -->\n")
     dest.write (schema.dumpXML ().encode ('utf-8'))
     dest.close ()
 
@@ -322,14 +322,14 @@
 
         vmatch = re.compile ('^([+-]{0,1})(\d+)[\.]{0,1}(\d*)$').match (res)
         if vmatch is None:
-          raise EInvalidValue (res, _("is not a valid number."))
+          raise EInvalidValue (res, _("%s is not a valid number."))
 
           sign = vmatch.groups () [0]
           pre  = vmatch.groups () [1]
           frac = vmatch.groups () [2]
 
           if len (pre) > (flength-fscale) or len (frac) > fscale:
-            raise EInvalidValue (res, _("exceeds precision (%d.%d)") % \
+            raise EInvalidValue (res, _("%%s exceeds precision (%d.%d)") % \
                                        (flength, fscale))
 
       return res
@@ -347,7 +347,7 @@
         return native.date
 
       else:
-        raise EInvalidValue (native, _("is not a valid date object"))
+        raise EInvalidValue (native, _("%s is not a valid date object"))
 
 
     elif datatype == "time":
@@ -358,7 +358,7 @@
         return str (native)
 
       else:
-        raise EInvalidValue (native, _("is not a valid time object"))
+        raise EInvalidValue (native, _("%s is not a valid time object"))
 
 
     elif datatype == "datetime":
@@ -366,7 +366,7 @@
         return str (native)
 
       else:
-        raise EInvalidValue (native, _("is not a valid datetime object"))
+        raise EInvalidValue (native, _("%s is not a valid datetime object"))
 
     else:
       # must be reference property

Modified: trunk/gnue-appserver/src/geasConfiguration.py
===================================================================
--- trunk/gnue-appserver/src/geasConfiguration.py       2004-03-08 10:28:53 UTC 
(rev 5259)
+++ trunk/gnue-appserver/src/geasConfiguration.py       2004-03-08 13:38:06 UTC 
(rev 5260)
@@ -49,17 +49,15 @@
 
   { 'Name'       : 'allowed_hosts',
     'Type'       : 'Setting',
-    'Comment'    : _('Hosts which are allowed to access appserver.'),
-    'Description': _('Hosts which are allowed to access appserver.'),
+    'Comment'    : _('Hosts which are allowed to access appserver'),
+    'Description': _('Hosts which are allowed to access appserver'),
     'Typecast'   : GTypecast.text,
     'Default'    : '' },
 
   { 'Name'       : 'httpdir',
     'Type'       : 'Setting',
-    'Comment'    : _('Directory, where files which appserver should serve 
per'+\
-                   ' http are stored'),
-    'Description': _('Directory, where files which appserver should serve 
per'+\
-                     ' http are stored'),
+    'Comment'    : _('Directory for webfrontend http documents'),
+    'Description': _('Directory for webfrontend http documents'),
     'Typecast'   : GTypecast.text,
     'Default'    : "/this_dir_shouldn't exist." }, # default should be 
overridden
 )

Modified: trunk/gnue-appserver/src/geasRpcServer.py
===================================================================
--- trunk/gnue-appserver/src/geasRpcServer.py   2004-03-08 10:28:53 UTC (rev 
5259)
+++ trunk/gnue-appserver/src/geasRpcServer.py   2004-03-08 13:38:06 UTC (rev 
5260)
@@ -21,16 +21,21 @@
 #
 # $Id$
 
+import time
+import os
+import sys
+
+import gnue.paths
+
+from gnue.common.apps import GConfig
+from gnue.common.apps.GServerApp import GServerApp
+from gnue.common.datasources import GLoginHandler
+from gnue.common.rpc import GComm
+from gnue.common.utils.FileUtils import openResource
+
 from gnue.appserver import VERSION
 from gnue.appserver import geasSessionManager
 from gnue.appserver import geasConfiguration
-from gnue.common.rpc import GComm
-from gnue.common.datasources import GLoginHandler
-from gnue.common.apps import GConfig
-from gnue.common.utils.FileUtils import openResource
-from gnue.common.apps.GServerApp import GServerApp
-import gnue.paths
-import time, os, sys
 
 # =============================================================================
 # RPC application class
@@ -42,35 +47,44 @@
   VERSION = VERSION
   USAGE = GServerApp.USAGE
   COMMAND = 'gnue-appserver'
-  SUMMARY = _("GNUe Application Server is a data and business rules server. " \
-            + "It provides a backend to forms and reports. In an n-tier " \
-            + "environment, it holds all business rules/logic and provides " \
-            + "data access to various database backends.")
+  SUMMARY = _(
+"""The GNUe Application Server is the core of the n-tier variant of the
+GNU Enterprise system. To the front end (be it GNUe Forms, GNUe Reports or
+any other tool), it provides user-defineable business objects with arbitary
+fields and methods. While transforming access to those fields and methods
+into database communication and calling of scripts, it cares about stability,
+security, speed, and consistency.""")
 
   COMMAND_OPTIONS = [
-    [ 'rpctype',None,'rpc-type',1,None, 'type',
-      _('Set the GNURPC connection type. The currently supported values '+
-        "for <type> are 'xmlrpc','xmlrpc.py_xmlrpc', 'xmlrpc.pw_xmlrpc'"+
-        "and 'pyro'. For more information on GNURPC connection types have "+
-        'a look at common/doc/RPC-abstraction. ')],
-    [ 'rpcport',None,'rpc-port',1,None, 'port',
-      _('Set the GNURPC port. For more information on ' +
-        'GNURPC have a look at common/doc/RPC-abstraction. ')],
-    [ 'database',None,'database',1,None, 'name',
-      _('Set the Database to use for loading and storing data to '+
-        "<name>. Appserver will search for it in "+
-        'connections.conf. ')],
-    [ 'username',"u",'username',1,None, 'user',
-      _('Set the username for the used database.')],
-    [ 'password',"p",'password',1,None, 'password',
-      _('Set the password for the used database.')],
-    [ 'selftest',None,'selftest',0,None, None,
-      _('Test appservers connection to the backend database, check '+
-        'correctness of global settings, etc..')],
-    [ 'web-frontend',None,'web-frontend',0,None, None,
-      _('Enable appservers web frontend. Just works for the rpc-type XMLRPC. '+
-        'The webfrontend is at the same port as XMLRPC. ')]]
 
+    ['rpctype', None, 'rpc-type', 1, None, 'type', _(
+"""Set the GNURPC connection type.  The currently supported values for <type>
+are 'xmlrpc', 'xmlrpc.py_xmlrpc', 'xmlrpc.pw_xmlrpc' and 'pyro'.  For more
+information on GNURPC connection types have a look at
+common/doc/RPC-abstraction.""")],
+
+    ['rpcport', None, 'rpc-port', 1, None, 'port', _(
+"""Set the GNURPC port.  For more information on GNURPC have a look at
+common/doc/RPC-abstraction.""")],
+
+    ['database', None, 'database', 1, None, 'name', _(
+"""Set the Database to use for loading and storing data to <name>.
+gnue-appserver will search for it in connections.conf.""")],
+
+    ['username', 'u', 'username', 1, None, 'user', _(
+"""Set the username for the used database.""")],
+
+    ['password', 'p', 'password', 1, None, 'password', _(
+"""Set the password for the used database.""")],
+
+    ['selftest', None, 'selftest', 0, None, None, _(
+"""Test appservers connection to the backend database, check correctness of
+global settings, etc.""")],
+
+    ['web-frontend', None, 'web-frontend', 0, None, None, _(
+"""Enable appservers web frontend. Just works for the rpc-type XMLRPC.  The
+webfrontend is at the same port as XMLRPC.""")]]
+
 #  USE_DATABASE_OPTIONS = 1 # Conflicts with the existing username and password
 
   # ---------------------------------------------------------------------------
@@ -198,32 +212,36 @@
 
   def selftest (self):
     ## Starting Appserver selftest
-    print _("\nGNUe Application Server is running a simple self test\n")
-    print _("=====================================================\n")
+    print _(
+"""
+GNUe Application Server is running a simple self test
+=====================================================
 
-    print _("PREREQUISITE: You have to populate the backend db with ")
-    print _('the "address_person" example.\n')
+PREREQUISITE: You have to populate the backend db with
+'the "address_person" example.
+""")
 
-    print _("Step 1: Startup Session Manager\n")
+    print _("Step 1: Starting Session Manager ...")
     sm = self.requestSessionManager ()
 
-    print _("Step 2: Logging into the session (as user 'hacker'"+\
-            "with password 'secret')...\n")
+    print _("Step 2: Opening session (user 'hacker', password 'secret') ...")
     session=sm.open ({'user':"hacker", 'password':"secret"})
 
-    print _("\nStep 3: Creating and populating list object ...\n")
+    print _("Step 3: Creating object list ...")
     list = sm.request (session, "address_person", [], ["address_zip"],
                        ["address_name", "address_street", "address_city"])
 
-    print _("Step 4: Retrieving first instance ...\n")
+    print _("Step 4: Retrieving first instance ...")
     rset = sm.fetch (session,list,0,1)
 
-    print _("These are the values of the first instance:")
-    print _("  Name  : %s") % rset[0][1]
-    print _("  Street: %s") % rset[0][2]
-    print _("  City  : %s") % rset[0][3]
+    print _("""
+These are the values of the first instance:
+  Name  : %s
+  Street: %s
+  City  : %s
+""") % (rset[0][1], rset[0][2], rset[0][3])
 
-    print _('\n\nSelftest passed!\n')
+    print _('Selftest passed!')
 
 # =============================================================================
 # Login Handler





reply via email to

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