4 |
# |
# |
5 |
# This file is part of GNU Enterprise. |
# This file is part of GNU Enterprise. |
6 |
# |
# |
7 |
# GNU Enterprise is free software; you can redistribute it |
# GNU Enterprise is free software; you can redistribute it |
8 |
# and/or modify it under the terms of the GNU General Public |
# and/or modify it under the terms of the GNU General Public |
9 |
# License as published by the Free Software Foundation; either |
# License as published by the Free Software Foundation; either |
10 |
# version 2, or (at your option) any later version. |
# version 2, or (at your option) any later version. |
11 |
# |
# |
12 |
# GNU Enterprise is distributed in the hope that it will be |
# GNU Enterprise is distributed in the hope that it will be |
13 |
# useful, but WITHOUT ANY WARRANTY; without even the implied |
# useful, but WITHOUT ANY WARRANTY; without even the implied |
14 |
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
15 |
# PURPOSE. See the GNU General Public License for more details. |
# PURPOSE. See the GNU General Public License for more details. |
16 |
# |
# |
17 |
# You should have received a copy of the GNU General Public |
# You should have received a copy of the GNU General Public |
18 |
# License along with program; see the file COPYING. If not, |
# License along with program; see the file COPYING. If not, |
19 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
20 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
21 |
# |
# |
22 |
# $Id$ |
# $Id$ |
35 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
36 |
# Create a session manager object |
# Create a session manager object |
37 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
38 |
|
|
39 |
def getSessionManager (self): |
def getSessionManager (self): |
40 |
# set up login handler |
# set up login handler |
41 |
self.connections.setLoginHandler (testLoginHandler ()) |
self.connections.setLoginHandler (testLoginHandler ()) |
42 |
|
|
43 |
print "Creating session manager ..." |
print "Creating session manager ..." |
44 |
sm = geasSessionManager.geasSessionManager (self.connections) |
sm = geasSessionManager.geasSessionManager (self.connections) |
45 |
|
|
46 |
return sm |
return sm |
47 |
|
|
48 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
49 |
# Main program |
# Main program |
50 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
51 |
|
|
52 |
def run (self): |
def run (self): |
53 |
sm = self.getSessionManager () |
sm = self.getSessionManager () |
54 |
|
|
55 |
print "Opening session ..." |
print "Opening session ..." |
56 |
session = sm.open ({"user":"hacker", "password":"secret"}) |
session = sm.open ({"user":"hacker", "password":"secret"}) |
57 |
|
|