~ubuntu-branches/ubuntu/trusty/spyder/trusty-backports

« back to all changes in this revision

Viewing changes to spyderlib/widgets/externalshell/systemshell.py

  • Committer: Bazaar Package Importer
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2011-03-05 18:03:43 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110305180343-its88tucbyvtevjf
Tags: 2.0.8-1
* Imported Upstream version 2.0.8 (Closes: #609789)
* add a watch file
* build for all python2 versions (it can be use as module by other packages)
* change the documentation section to Programming/Python
* use the Recommendes found in the documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
#
3
 
# Copyright © 2009 Pierre Raybaut
 
3
# Copyright © 2009-2010 Pierre Raybaut
4
4
# Licensed under the terms of the MIT License
5
5
# (see spyderlib/__init__.py for details)
6
6
 
17
17
 
18
18
# Local imports
19
19
from spyderlib.utils import encoding
 
20
from spyderlib.utils.programs import split_clo
20
21
from spyderlib.config import get_icon
21
 
from spyderlib.widgets.externalshell import (ExternalShellBase,
22
 
                                             add_pathlist_to_PYTHONPATH)
 
22
from spyderlib.widgets.externalshell.baseshell import (ExternalShellBase,
 
23
                                                   add_pathlist_to_PYTHONPATH)
23
24
from spyderlib.widgets.shell import TerminalWidget
24
25
 
25
26
 
26
27
class ExternalSystemShell(ExternalShellBase):
27
28
    """External Shell widget: execute Python script in a separate process"""
28
29
    SHELL_CLASS = TerminalWidget
29
 
    def __init__(self, parent=None, wdir=None, path=[]):
 
30
    def __init__(self, parent=None, wdir=None, path=[], light_background=True,
 
31
                 menu_actions=None, show_buttons_inside=True,
 
32
                 show_elapsed_time=True):
30
33
        ExternalShellBase.__init__(self, parent, wdir,
31
 
                                   history_filename='.history_ec')
 
34
                                   history_filename='.history',
 
35
                                   light_background=light_background,
 
36
                                   menu_actions=menu_actions,
 
37
                                   show_buttons_inside=show_buttons_inside,
 
38
                                   show_elapsed_time=show_elapsed_time)
32
39
        
33
40
        # Additional python path list
34
41
        self.path = path
58
65
            p_args = ['-i']
59
66
            
60
67
        if self.arguments:
61
 
            p_args.extend( self.arguments.split(' ') )
 
68
            p_args.extend( split_clo(self.arguments) )
62
69
                        
63
70
        self.connect(self.process, SIGNAL("readyReadStandardOutput()"),
64
71
                     self.write_output)