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

« back to all changes in this revision

Viewing changes to services/python-console

  • Committer: William Grant
  • Date: 2009-01-13 01:36:15 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1123
Merge setup-refactor branch. This completely breaks existing installations;
every path (both filesystem and Python) has changed. Do not upgrade without
knowing what you are doing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
import traceback
17
17
from threading import Thread
18
18
 
19
 
import common.chat
20
 
import common.util
 
19
import ivle.chat
 
20
import ivle.util
21
21
 
22
22
# This version must be supported by both the local and remote code
23
23
PICKLEVERSION = 0
67
67
        '''Trim an incomplete UTF-8 character from the end of a string.
68
68
           Returns (trimmed_string, count_of_trimmed_bytes).
69
69
        '''
70
 
        tokill = common.util.incomplete_utf8_sequence(stuff)
 
70
        tokill = ivle.util.incomplete_utf8_sequence(stuff)
71
71
        if tokill == 0:
72
72
            return (stuff, tokill)
73
73
        else:
366
366
    if msg['cmd'] == 'terminate':
367
367
        terminate = "User requested console be terminated"
368
368
    if terminate:
369
 
        raise common.chat.Terminate({"terminate":terminate})
 
369
        raise ivle.chat.Terminate({"terminate":terminate})
370
370
    expiry.ping()
371
371
    lineQ.put((msg['cmd'],msg['text']))
372
372
    response = cmdQ.get()
373
373
    if terminate:
374
 
        raise common.chat.Terminate({"terminate":terminate})
 
374
        raise ivle.chat.Terminate({"terminate":terminate})
375
375
    return response
376
376
 
377
377
def format_exc_start(start=0):
393
393
            try:
394
394
                o_type = type(object[o]).__name__
395
395
                o_name = object[o].__name__
396
 
                fake_o = common.util.FakeObject(o_type, o_name)
 
396
                fake_o = ivle.util.FakeObject(o_type, o_name)
397
397
                flat[o] = cPickle.dumps(fake_o, PICKLEVERSION)
398
398
            except AttributeError:
399
399
                pass
415
415
    # Make python's search path follow the cwd
416
416
    sys.path[0] = ''
417
417
 
418
 
    common.chat.start_server(port, magic, True, dispatch_msg, initializer)
 
418
    ivle.chat.start_server(port, magic, True, dispatch_msg, initializer)