Ejemplo n.º 1
0
def paste_build_variable(edit, key=None, view=None, window=None):
    """If key is None, show a quick panel with the currently available build
    variables."""
    variables = suricate.extract_variables(window)
    on_done = lambda picked: insert(picked[1], edit, view, clear=True)
    if key is None:
        show_quick_panel(sorted([[k, i] for k, i in variables.items()]), on_done)
    else:
        on_done([None, variables[key]])
Ejemplo n.º 2
0
def copy_build_variable_to_clipboard(key=None, window=None):
    """If key is None, show a quick panel with the currently available build
    variables."""
    append_suricate_variables = suricate.get_setting('dev_mode', False)
    variables = suricate.extract_variables(window, append_suricate_variables)
    on_done = lambda picked: sublime.set_clipboard(picked[1])
    if key is None:
        show_quick_panel(sorted([[k, i] for k, i in variables.items()]), on_done)
    else:
        on_done([None, variables[key]])
Ejemplo n.º 3
0
def _get_path_prefix(window):
    variables = suricate.extract_variables(window)
    return os.path.abspath(os.path.join(variables["file_path"], variables["file_base_name"]))