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

« back to all changes in this revision

Viewing changes to scripts/python-console

  • Committer: mattgiuca
  • Date: 2008-02-28 06:49:03 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:603
Console now starts up in the user's home directory.
scripts/python-console: Now accepts an optional argument <working-dir>.
    If supplied, it will chdir into that dir before launching the console.
consoleservice: Now passes working-dir as an argument - this is the user's
    home directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
3
3
# usage:
4
 
#   python-console <port> <magic>
 
4
#   python-console <port> <magic> [<working-dir>]
5
5
 
6
6
import cjson
7
7
import codeop
172
172
if __name__ == "__main__":
173
173
    port = int(sys.argv[1])
174
174
    magic = sys.argv[2]
 
175
    if len(sys.argv) >= 4:
 
176
        # working_dir
 
177
        os.chdir(sys.argv[3])
175
178
 
176
179
    common.chat.start_server(port, magic, True, dispatch_msg, initializer)