Changeset 2562

Show
Ignore:
Timestamp:
07/03/09 01:54:14 (9 months ago)
Author:
thijs
Message:

Add shell client

Location:
examples/branches/clients-603/shell/python
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • examples/branches/clients-603/shell/python/gateway.py

    r2413 r2562  
    1414import StringIO 
    1515 
     16import pyamf 
    1617from pyamf.remoting.gateway.django import DjangoGateway 
    1718 
     
    173174    buffer = StringIO.StringIO() 
    174175 
    175     buffer.write(statement + '\n') 
    176  
    177176    try: 
    178177        session = request.session['shell_session'] 
     
    193192    except: 
    194193      buffer.write(traceback.format_exc()) 
    195      
    196     buffer.write('>>> ') 
    197194 
    198195    return buffer.getvalue() 
    199196 
    200197  def startup(self, request): 
    201     return "Welcome to the PyAMF Python Shell Demo!\n\n>>> " 
     198    header = 'Welcome to the PyAMF %s Shell Demo!\n' \ 
     199           'Python %s on %s\n' \ 
     200           'Type "help", "copyright", "credits" or "license" for more information.' % \ 
     201           (pyamf.version, sys.version, sys.platform) 
     202 
     203    return header 
    202204 
    203205