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

« back to all changes in this revision

Viewing changes to scripts/python-console

  • Committer: dcoles
  • Date: 2008-04-25 12:37:44 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:749
Console: Override the sys.path on the console process so it's search path follows the cwd of the console (like how the commandline console works in interactive mode). This means you can now import modules in the $HOME directory. Ideally this should be the cwd of the browser (or just $HOME if it's a stand alone console), but at present there is no facility to set the cwd of the console when initilized. (So, we'll just stick with standalone mode for the moment)

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
    if len(sys.argv) >= 4:
191
191
        # working_dir
192
192
        os.chdir(sys.argv[3])
 
193
        # Make python's search path follow the cwd
 
194
        sys.path[0] = ''
193
195
        os.environ['HOME'] = sys.argv[3]
194
196
 
195
197
    common.chat.start_server(port, magic, True, dispatch_msg, initializer)