Пример #1
0
def create_program_action(parent, text, icon, name, nt_name=None):
    """Create action to run a program"""
    if os.name == 'nt':
        if nt_name is not None:
            name = nt_name
        name = programs.get_nt_program_name(name)
    if isinstance(icon, basestring):
        icon = get_icon(icon)
    if programs.is_program_installed(name):
        return create_action(parent, text, icon=icon,
                             triggered=lambda: programs.run_program(name))
Пример #2
0
 def get_default_ipython_options(self):
     """Return default ipython command line arguments"""
     default_options = []
     if programs.is_module_installed('matplotlib'):
         default_options.append("-pylab")
     else:
         default_options.append("-q4thread")
     default_options.append("-colors LightBG")
     default_options.append("-xmode Plain")
     for editor_name in ("scite", "gedit"):
         real_name = programs.get_nt_program_name(editor_name)
         if programs.is_program_installed(real_name):
             default_options.append("-editor "+real_name)
             break
     return " ".join(default_options)
Пример #3
0
import os.path as osp

# For debugging purpose:
STDOUT = sys.stdout

# Local imports
from spyderlib.utils import programs
from spyderlib.utils.qthelpers import create_toolbutton, translate
from spyderlib.config import get_icon, get_conf_path
from spyderlib.widgets import OneColumnTree
from spyderlib.widgets.texteditor import TextEditor
from spyderlib.widgets.comboboxes import (PythonModulesComboBox,
                                          is_module_or_package)


PYLINT_PATH = programs.get_nt_program_name('pylint')

def is_pylint_installed():
    return programs.is_program_installed(PYLINT_PATH)

class ResultsTree(OneColumnTree):
    def __init__(self, parent):
        OneColumnTree.__init__(self, parent)
        self.filename = None
        self.results = None
        self.data = None
        self.set_title('')
        
    def activated(self):
        data = self.data.get(self.currentItem())
        if data is not None: