[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/appserver/src geasList.py geasRpcServer.py...
From: |
Jan Ischebeck |
Subject: |
gnue/appserver/src geasList.py geasRpcServer.py... |
Date: |
Wed, 29 May 2002 08:35:59 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jan Ischebeck <address@hidden> 02/05/29 08:35:59
Modified files:
appserver/src : geasList.py geasRpcServer.py geasSession.py
Log message:
add a rpctype and a database command option to appserver
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasList.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasRpcServer.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSession.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gnue/appserver/src/geasList.py
diff -c gnue/appserver/src/geasList.py:1.6 gnue/appserver/src/geasList.py:1.7
*** gnue/appserver/src/geasList.py:1.6 Sun May 26 17:15:29 2002
--- gnue/appserver/src/geasList.py Wed May 29 08:35:58 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.6 2002/05/26 21:15:29 reinhard Exp $
from gnue.common import GDataSource
import geasInstance
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.7 2002/05/29 12:35:58 siesel Exp $
from gnue.common import GDataSource
import geasInstance
***************
*** 62,68 ****
self._datasource = GDataSource.GDataSource ()
# TODO: get the table name from the class name
self._datasource.buildObject (name = "",
! database = "gnue",
table = self._classname)
self._datasource.setConnectionManager (self._session._connections)
--- 62,68 ----
self._datasource = GDataSource.GDataSource ()
# TODO: get the table name from the class name
self._datasource.buildObject (name = "",
! database = self._session._database,
table = self._classname)
self._datasource.setConnectionManager (self._session._connections)
Index: gnue/appserver/src/geasRpcServer.py
diff -c gnue/appserver/src/geasRpcServer.py:1.3
gnue/appserver/src/geasRpcServer.py:1.4
*** gnue/appserver/src/geasRpcServer.py:1.3 Mon May 6 18:32:59 2002
--- gnue/appserver/src/geasRpcServer.py Wed May 29 08:35:58 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasRpcServer.py,v 1.3 2002/05/06 22:32:59 siesel Exp $
from geasList import *
from geasSession import *
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasRpcServer.py,v 1.4 2002/05/29 12:35:58 siesel Exp $
from geasList import *
from geasSession import *
***************
*** 30,40 ****
def getNewSession(self):
self._sessNo=self._sessNo+1
! return geasSession (self._connections)
def setConnections(self,connections):
self._connections=connections
def Shutdown(self):
pass
--- 30,45 ----
def getNewSession(self):
self._sessNo=self._sessNo+1
! sess=geasSession (self._connections)
! sess._database=self._database
! return sess
def setConnections(self,connections):
self._connections=connections
+ def setDatabase(self,database):
+ self._database=database
+
def Shutdown(self):
pass
***************
*** 49,55 ****
from gnue.common import GComm, openResource, GLoginHandler
from gnue.common.GServerApp import GServerApp,GConfig
! import time,os
#
=============================================================================
# RPC application class
--- 54,60 ----
from gnue.common import GComm, openResource, GLoginHandler
from gnue.common.GServerApp import GServerApp,GConfig
! import time,os,sys
#
=============================================================================
# RPC application class
***************
*** 60,70 ****
NAME = "GNUe Application Server"
VERSION = "0.0.1"
## set a list of transports
def setTransports(self,transports):
self._transports=transports
!
def run(self):
--- 65,111 ----
NAME = "GNUe Application Server"
VERSION = "0.0.1"
+
+ COMMAND_OPTIONS = [
+ [ 'rpctype',None,'rpc_type',1,"xmlrpc", 'type',
+ _('Set the GNURPC connection type. The currently supported values ')+
+ _("for <type> are 'xmlrpc' and 'pw_xmlrpc'. For more information on ")+
+ _('GNURPC connection types have a look at ')+
+ _('common/doc/RPC-abstraction. ')],
+ [ 'database',None,'database',1,"gnue", 'name',
+ _('Set the Database to use for loading and storing data to ')+
+ _("<name>. Appserver will search for it in ")+
+ _('connections.conf. ')]]
+
## set a list of transports
def setTransports(self,transports):
self._transports=transports
!
!
! def phaseInit(self):
! if self.OPTIONS["rpctype"]=="xmlrpc":
!
! print "Exporting our services via xmlrpc (port 8765) ..."
! geas1.setTransports({'xmlrpc':{ 'port': 8765 }})
!
! elif self.OPTIONS["rpctype"]=="pw_xmlrpc":
!
! print "Exporting our services via pw_xmlrpc (port 8765) ..."
! geas1.setTransports({'pw_xmlrpc':{ 'port': 8765 }})
!
! elif self.OPTIONS["rpctype"]=="sockets":
!
! # Sockets not working yet
! print "Exporting our services via sockets (port 8765) ..."
! geas1.setTransports({'sockets':{ 'port': 8765 }})
!
! else:
!
! # not transport protocol set. exiting
! print "The protocol you've set is currently not supported."
! sys.exit(-1)
!
def run(self):
***************
*** 91,96 ****
--- 132,138 ----
sm=geasSessionManager()
self.connections.setLoginHandler (testLoginHandler ())
sm.setConnections(self.connections)
+ sm.setDatabase(self.OPTIONS["database"])
return sm
#
=============================================================================
***************
*** 110,127 ****
if __name__ == '__main__':
geas1 = geasRpcServer();
-
- print "Exporting our services via xmlrpc (port 8765) ..."
- geas1.setTransports({'xmlrpc':{ 'port': 8765 }})
-
- #print "Exporting our services via pw_xmlrpc (port 8765) ..."
- #geas1.setTransports({'pw_xmlrpc':{ 'port': 8765 }})
-
- # Sockets not working yet
- #print "Exporting our services via sockets (port 8765) ..."
- #geas1.setTransports({'sockets':{ 'port': 8765 }})
! print "\n... GEAS up and running ...\n"
geas1.run();
--- 152,160 ----
if __name__ == '__main__':
geas1 = geasRpcServer();
+ geas1.phaseInit()
! print "\n... GNUe Application Server up and running ...\n"
geas1.run();
Index: gnue/appserver/src/geasSession.py
diff -c gnue/appserver/src/geasSession.py:1.6
gnue/appserver/src/geasSession.py:1.7
*** gnue/appserver/src/geasSession.py:1.6 Sun May 26 17:15:29 2002
--- gnue/appserver/src/geasSession.py Wed May 29 08:35:58 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasSession.py,v 1.6 2002/05/26 21:15:29 reinhard Exp $
import geasList
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasSession.py,v 1.7 2002/05/29 12:35:58 siesel Exp $
import geasList
***************
*** 36,41 ****
--- 36,42 ----
def __init__ (self, connections):
self.loggedIn = 0
self._connections = connections
+ self._database = "gnue"
self._activelists = []
#
---------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/appserver/src geasList.py geasRpcServer.py...,
Jan Ischebeck <=