예제 #1
0
def get_quickly_editors():
    '''Return prefered editor for ubuntu-application template'''

    default_editor = os.environ.get("QUICKLY_EDITOR")
    if not default_editor:
        default_editor = os.environ.get("EDITOR")
    if not default_editor:
        default_editor = os.environ.get("SELECTED_EDITOR")
    if default_editor:
        editor = default_editor
    elif templatetools.is_X_display():
        editor = "gedit"
    else:
        editor = "nano"
    return editor
예제 #2
0
def get_quickly_editors():
    '''Return prefered editor for git-python-gtk template'''

    default_editor = os.environ.get("QUICKLY_EDITOR")
    if not default_editor:
        default_editor = os.environ.get("EDITOR")
    if not default_editor:
        default_editor = os.environ.get("SELECTED_EDITOR")
    if default_editor:
        editor = default_editor
    elif templatetools.is_X_display():
        editor = "gedit"
    else:
        editor = "nano"
    return editor
예제 #3
0
파일: create.py 프로젝트: GhostBSD/apace
print _("Creating bzr repository and committing")
bzr_instance = subprocess.Popen(["bzr", "init"], stdout=subprocess.PIPE)
bzr_instance.wait()
bzr_instance = subprocess.Popen(["bzr", "add"], stdout=subprocess.PIPE)
bzr_instance.wait()
bzr_instance = subprocess.Popen(["bzr", "commit", "-m", "Initial project creation with Quickly!"], stderr=subprocess.PIPE)

env = os.environ.copy()
# Compile schema if present
schemapath = os.path.abspath("data/glib-2.0/schemas")
if os.path.exists(schemapath):
    subprocess.call(["glib-compile-schemas", schemapath])

    datadir = os.path.abspath("data")
    if 'XDG_DATA_DIRS' in env:
        env['XDG_DATA_DIRS'] = "%s:%s" % (datadir, env['XDG_DATA_DIRS'])
    else:
        env['XDG_DATA_DIRS'] = datadir

# run the new application if X display
exec_file = os.path.join('bin', project_name)
if templatetools.is_X_display() and os.path.isfile(exec_file):
    print _("Launching your newly created project!")
    subprocess.call(['./' + project_name], cwd='bin/', env=env)

bzr_instance.wait()

print _("Congrats, your new project is setup! cd %s/ to start hacking.") % os.getcwd()

sys.exit(0)
예제 #4
0
    templatetools.print_usage(_('quickly debug -- [program arguments]'))
def help():
    print _("""Debugs your application with winpdb.

$ quickly debug -- values -<whatever>
to pass '-whatever' and 'values' to the executed program. Without that
if you use for instance --help, it would be Quickly help and not your
program one.""")
templatetools.handle_additional_parameters(sys.argv, help, usage=usage)

# if config not already loaded
if not configurationhandler.project_config:
    configurationhandler.loadConfig()

# check if we can execute a graphical project
if not templatetools.is_X_display():
    print _("Can't access to X server, so can't run winpdb")
    sys.exit(1)

project_bin = 'bin/' + configurationhandler.project_config['project']
command_line = ["winpdb", project_bin]
command_line.extend([arg for arg in sys.argv[1:] if arg != "--"])

# run with args if bin/project exist
st = os.stat(project_bin)
mode = st[stat.ST_MODE]
if mode & stat.S_IEXEC:
    nullfile = file("/dev/null")
    subprocess.Popen(" ".join(command_line), shell=True, stderr=nullfile)
else:
    print _("Can't execute winpdb")
예제 #5
0
while you are developing it. It starts up the main project window.

$ quickly run -- values -<whathever>
to pass '-whatever' and 'values' to the executed program. Without that
if you use for instance --help, it would be Quickly help and not your
program one.""")


templatetools.handle_additional_parameters(sys.argv, help, usage=usage)

# if config not already loaded
if not configurationhandler.project_config:
    configurationhandler.loadConfig()

# check if we can execute a graphical project
if not templatetools.is_X_display():
    print _("Can't access to X server, so can't run gtk application")
    sys.exit(1)

env = os.environ.copy()
# Compile schema if present
schemapath = os.path.abspath("data/glib-2.0/schemas")
if os.path.exists(schemapath):
    subprocess.call(["glib-compile-schemas", schemapath])

    datadir = os.path.abspath("data")
    if 'XDG_DATA_DIRS' in env:
        env['XDG_DATA_DIRS'] = "%s:%s" % (datadir, env['XDG_DATA_DIRS'])
    else:
        env['XDG_DATA_DIRS'] = datadir
예제 #6
0
파일: create.py 프로젝트: dreamsxin/quickly
bzr_instance = subprocess.Popen(["bzr", "add"], stdout=subprocess.PIPE)
bzr_instance.wait()
bzr_instance = subprocess.Popen(
    ["bzr", "commit", "-m", "Initial project creation with Quickly!"],
    stderr=subprocess.PIPE)

env = os.environ.copy()
# Compile schema if present
schemapath = os.path.abspath("data/glib-2.0/schemas")
if os.path.exists(schemapath):
    subprocess.call(["glib-compile-schemas", schemapath])

    datadir = os.path.abspath("data")
    if 'XDG_DATA_DIRS' in env:
        env['XDG_DATA_DIRS'] = "%s:%s" % (datadir, env['XDG_DATA_DIRS'])
    else:
        env['XDG_DATA_DIRS'] = datadir

# run the new application if X display
exec_file = os.path.join('bin', project_name)
if templatetools.is_X_display() and os.path.isfile(exec_file):
    print _("Launching your newly created project!")
    subprocess.call(['./' + project_name], cwd='bin/', env=env)

bzr_instance.wait()

print _("Congrats, your new project is setup! cd %s/ to start hacking."
        ) % os.getcwd()

sys.exit(0)