~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to services/python-console

  • Committer: William Grant
  • Date: 2010-02-25 09:10:36 UTC
  • Revision ID: grantw@unimelb.edu.au-20100225091036-urjqg7cbvvmlmd7s
Print a CPythonesque version on console startup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
 
182
182
        # Handlers for each action
183
183
        actions = {
 
184
            'splash': self.handle_splash,
184
185
            'chat': self.handle_chat,
185
186
            'block': self.handle_block,
186
187
            'globals': self.handle_globals,
198
199
                response = {'error': repr(e)}
199
200
            finally:
200
201
                self.cmdQ.put(response)
201
 
                   
 
202
 
 
203
    def handle_splash(self, params):
 
204
        # Initial console splash screen
 
205
        python_version = '.'.join(str(v) for v in sys.version_info[:3])
 
206
        splash_text = ("""IVLE Python Console (Python %s)
 
207
Type "help", "copyright", "credits" or "license" for more information.
 
208
""" % python_version)
 
209
        return {'output': splash_text}
 
210
 
202
211
    def handle_chat(self, params):
203
212
        # Set up the partial cmd buffer
204
213
        if self.curr_cmd == '':