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

« back to all changes in this revision

Viewing changes to services/python-console

  • Committer: David Coles
  • Date: 2010-02-26 10:44:48 UTC
  • Revision ID: coles.david@gmail.com-20100226104448-4d1r3qco3shgn1gk
Tags: 1.0rc2
console: Make sure HOME is set correctly (not always the same as CWD). Also use ivle.interpret.execute_raw rather than duplicating trapoline calling code in ivle.chat

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import cPickle
9
9
import cStringIO
10
10
import md5
11
 
import os
12
11
import Queue
13
12
import signal
14
13
import socket
421
420
if __name__ == "__main__":
422
421
    port = int(sys.argv[1])
423
422
    magic = sys.argv[2]
424
 
    
425
 
    # Sanitise the Enviroment
426
 
    os.environ = {}
427
 
    os.environ['PATH'] = '/usr/local/bin:/usr/bin:/bin'
428
 
 
429
 
    if len(sys.argv) >= 4:
430
 
        # working_dir
431
 
        os.chdir(sys.argv[3])
432
 
        os.environ['HOME'] = sys.argv[3]
433
423
 
434
424
    # Make python's search path follow the cwd
435
425
    sys.path[0] = ''