def create_program_action(parent, text, icon, name, nt_name=None): """Create action to run a program""" if os.name == 'nt' and nt_name is not None: name = nt_name path = programs.find_program(name) if path is not None: return create_action(parent, {"text": text, "icon": icon, "triggered": lambda: programs.run_program(name)})
def create_program_action(parent, text, icon, name, nt_name=None): """Create action to run a program""" if os.name == 'nt' and nt_name is not None: name = nt_name path = programs.find_program(name) if path is not None: return create_action( parent, { "text": text, "icon": icon, "triggered": lambda: programs.run_program(name) })
import re import sys import os import stat import tempfile import codecs from prymatex.utils import encoding from prymatex.utils import osextra from prymatex.utils import programs RE_SHEBANG = re.compile("^#!(.*)$") RE_SHEBANG_ENVKEY = re.compile("(\w+)_SHEBANG") ENV = programs.find_program("env") SH = programs.find_program("sh") CYGWIN = programs.find_program("cygwin") """ Working with shebangs http://en.wikipedia.org/wiki/Shebang_(Unix) In memory of Dennis Ritchie http://en.wikipedia.org/wiki/Dennis_Ritchie """ def getShellShebang(environment): return "#!/bin/bash" return "#!%s" % environment.get("SHELL", SH)