[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/appserver INSTALL src/test.py src/geas_rpc...
From: |
Jan Ischebeck |
Subject: |
gnue/appserver INSTALL src/test.py src/geas_rpc... |
Date: |
Tue, 30 Apr 2002 14:03:18 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jan Ischebeck <address@hidden> 02/04/30 14:03:18
Modified files:
appserver : INSTALL
appserver/src : test.py geas_rpc_client.py
Log message:
added more info to use the RPC demo and split RPC demo from normal demo
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/INSTALL.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/test.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geas_rpc_client.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gnue/appserver/INSTALL
diff -c gnue/appserver/INSTALL:1.1 gnue/appserver/INSTALL:1.2
*** gnue/appserver/INSTALL:1.1 Thu Apr 18 12:02:18 2002
--- gnue/appserver/INSTALL Tue Apr 30 14:03:18 2002
***************
*** 1,2 ****
! This is a preview release. There is no need to go through some special
! installation process; everything can be run from the source directory.
--- 1,42 ----
!
!
! This is a preview release. There is no special installation
! process; everything can be run from the source directory.
!
!
! Based on a simple example, there are three programms you can test:
!
! 1. python test.py
! =================
!
! A simple test of the application server.
!
!
! 2. python geas_rpc_server.py
! ============================
!
! The same example, just using GNURPC. (server part)
! Attention: You have to setup GNURPC first (see below).
!
! 3. python geas_rpc_client.py
! ============================
!
! The same example, just using GNURPC. (client part)
! Attention: You have to setup GNURPC first (see below).
!
!
! How to setup GNURPC:
! --------------------
!
!
! 1. install the newest version of GNUE/common from CVS
!
! 2. get all python librarys for the protocolls you want to test.
! (have a look at common/doc/RPC-Status.txt for the supported
! protocolls)
!
! 3. setup your PYTHONPATH to include GNUE/common in it
! (if you are running GNU Forms from your local cvs copy
! just get the path settings from ~/bin/gfcvs )
!
! 4. now you can call the RPC appserver test
Index: gnue/appserver/src/geas_rpc_client.py
diff -c gnue/appserver/src/geas_rpc_client.py:1.1
gnue/appserver/src/geas_rpc_client.py:1.2
*** gnue/appserver/src/geas_rpc_client.py:1.1 Mon Apr 22 11:30:38 2002
--- gnue/appserver/src/geas_rpc_client.py Tue Apr 30 14:03:18 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geas_rpc_client.py,v 1.1 2002/04/22 15:30:38 siesel Exp $
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geas_rpc_client.py,v 1.2 2002/04/30 18:03:18 siesel Exp $
***************
*** 52,54 ****
--- 52,104 ----
# rpcClient = geas_rpc_client('xmlrpc',params)
# sessMan = requestSessionManager()
# print sessMan.Status
+
+
+ if __name__ == "__main__":
+
+ from geas_session import *
+ from geas_list import *
+ from geas_instance import *
+
+ print "Opening RPC connection ..."
+ params = { 'host': 'localhost',
+ 'port': 8765,
+ 'transport': 'http' }
+ rpcClient = geas_rpc_client('xmlrpc',params)
+
+ print "Setup an link to the session manager"
+ sessionManager = rpcClient.requestSessionManager()
+
+ print "Get the status of the session manager"
+ print "Status: ",sessionManager.Status()
+
+ print "Creating session object ..."
+ #session = geas_session ()
+ session = sessionManager.getNewSession()
+
+ print "Logging into the session ..."
+ session.login ("hacker", "secret")
+
+ print "Creating list object ..."
+ list = session.create_list ("addressbook::person")
+
+ print "Setting up list object ..."
+ list.setPrefetch(["name", "street", "city"])
+ list.setConditions([])
+ list.setSort(["zip"])
+
+ print "Populating list ..."
+ list.populate
+
+ print "Retrieving first instance ..."
+ instance = list.first_instance ()
+
+ print "These are the values of the first instance:"
+ print instance.get ("name")
+ print instance.get ("street")
+ print instance.get ("city")
+
+ print "Get the status of the session manager again"
+ print "Status: ",sessionManager.Status()
+
+ print "Thank you for playing!"
Index: gnue/appserver/src/test.py
diff -c gnue/appserver/src/test.py:1.2 gnue/appserver/src/test.py:1.3
*** gnue/appserver/src/test.py:1.2 Mon Apr 22 11:30:38 2002
--- gnue/appserver/src/test.py Tue Apr 30 14:03:18 2002
***************
*** 19,47 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: test.py,v 1.2 2002/04/22 15:30:38 siesel Exp $
from geas_session import *
from geas_list import *
from geas_instance import *
! from geas_rpc_client import *
! print "Opening RPC connection ..."
! params = { 'host': 'localhost',
! 'port': 8765,
! 'transport': 'http' }
! rpcClient = geas_rpc_client('xmlrpc',params)
! print "Setup an link to the session manager"
! sessionManager = rpcClient.requestSessionManager()
! print "Get the status of the session manager"
! print "Status: ",sessionManager.Status()
print "Creating session object ..."
! #session = geas_session ()
! session = sessionManager.getNewSession()
print "Logging into the session ..."
session.login ("hacker", "secret")
--- 19,47 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: test.py,v 1.3 2002/04/30 18:03:18 siesel Exp $
from geas_session import *
from geas_list import *
from geas_instance import *
! #from geas_rpc_client import *
! #print "Opening RPC connection ..."
! #params = { 'host': 'localhost',
! # 'port': 8765,
! # 'transport': 'http' }
! #rpcClient = geas_rpc_client('xmlrpc',params)
! #print "Setup an link to the session manager"
! #sessionManager = rpcClient.requestSessionManager()
! #print "Get the status of the session manager"
! #print "Status: ",sessionManager.Status()
print "Creating session object ..."
! session = geas_session ()
! #session = sessionManager.getNewSession()
print "Logging into the session ..."
session.login ("hacker", "secret")
***************
*** 65,71 ****
print instance.get ("street")
print instance.get ("city")
! print "Get the status of the session manager again"
! print "Status: ",sessionManager.Status()
print "Thank you for playing!"
--- 65,71 ----
print instance.get ("street")
print instance.get ("city")
! #print "Get the status of the session manager again"
! #print "Status: ",sessionManager.Status()
print "Thank you for playing!"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/appserver INSTALL src/test.py src/geas_rpc...,
Jan Ischebeck <=