当前位置: 首页>>代码示例>>Python>>正文


Python sublime.status_message方法代码示例

本文整理汇总了Python中sublime.status_message方法的典型用法代码示例。如果您正苦于以下问题:Python sublime.status_message方法的具体用法?Python sublime.status_message怎么用?Python sublime.status_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sublime的用法示例。


在下文中一共展示了sublime.status_message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self, *args, **kwargs):
        # wait until any previous thread is finished
        if self.thread and self.thread.is_alive():
            sublime.status_message('Waiting for earlier compilation to finish...')
            self.thread.stop()
            self.thread.join()

        # find the view containing the code to compile
        view = None
        if kwargs.get('recompile', None) and self.last_filename:
            view = CompileKspThread.find_view_by_filename(self.last_filename)
        if view is None:
            view = sublime.active_window().active_view()

        self.thread = CompileKspThread(view)
        self.thread.start()
        self.last_filename = view.file_name() 
开发者ID:nojanath,项目名称:SublimeKSP,代码行数:19,代码来源:ksp_plugin.py

示例2: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self):
        # Reload settings
        settings.load()

        # Ensure git executable is available
        if not self.git_executable_available():
            sublime.error_message(msgs.get('git_executable_not_found'))
            return

        self.git_repo = self.determine_git_repo()
        if not self.git_repo:
            sublime.status_message(msgs.get('no_git_repo_found'))
            return

        conflict_files = self.get_conflict_files()
        if not conflict_files:
            sublime.status_message(msgs.get('no_conflict_files_found', self.git_repo))
            return

        self.show_quickpanel_selection(conflict_files) 
开发者ID:sascha-wolf,项目名称:sublime-GitConflictResolver,代码行数:22,代码来源:GitConflictResolver.py

示例3: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self, edit, dirs):
        settings = sublime.load_settings('dired.sublime-settings')

        for key_name in ['reuse_view', 'bookmarks']:
            settings.set(key_name, settings.get(key_name))

        bm = bookmarks()
        for path in dirs :
            bm.append(path)
            settings.set('bookmarks', bm)

            # This command makes/writes a sublime-settings file at Packages/User/,
            # and doesn't write into one at Packages/dired/.
            sublime.save_settings('dired.sublime-settings')

            sublime.status_message('Bookmarking succeeded.')
            self.view.erase_regions('marked') 
开发者ID:kublaios,项目名称:dired,代码行数:19,代码来源:dired.py

示例4: on_activated

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def on_activated(self, view):
        # Don't check for solution files if the plugin is disabled
        if hacker_enabled is False:
            return

        # Check if the current file has a solution
        filename = view.file_name()
        if filename is None:
            return

        solution = filename + ".hackertyper"
        self.solution_exists = os.path.isfile(solution)

        # Give a feedback message if no solution was found
        # Clear the status bar if one was found
        if not self.solution_exists:
            err = "HackerTyper Error: " + os.path.basename(filename)
            err += ".hackertyper not found"
            return sublime.status_message(err)
        else:
            sublime.status_message("")

        # Read the entire solution text
        self.hacker_buffer = open(solution, encoding='utf-8').read() 
开发者ID:rexxars,项目名称:sublime-hacker-typer,代码行数:26,代码来源:hackertyper.py

示例5: set_virtualenv

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def set_virtualenv(self, venv):
        """Update the current virtualenv in project data.

        If the passed venv in None, remove virtualenv data from project.
        """
        project_data = self.window.project_data() or {}

        if venv:
            project_data['virtualenv'] = venv
            sublime.status_message("({}) ACTIVATED".format(os.path.basename(venv)))
        else:
            try:
                del project_data['virtualenv']
                sublime.status_message("DEACTIVATED")
            except KeyError:
                pass

        self.window.set_project_data(project_data)
        logger.info("Current virtualenv set to \"{}\".".format(venv)) 
开发者ID:AdrianLC,项目名称:sublime-text-virtualenv,代码行数:21,代码来源:commands.py

示例6: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self, edit):
        self.index = self.get_all()
        filenames = self.get_selected(full=True)

        if not filenames:
            return sublime.status_message(u'Nothing to preview')

        fqn = filenames[0]

        if isdir(fqn) or fqn == PARENT_SYM:
            if not ST3:
                return sublime.status_message(u'No preview for directories')
            self.view.run_command('dired_preview_directory', {'fqn': fqn})
            return

        if exists(fqn):
            if ST3:
                self.view.run_command('dired_file_properties', {'fqn': fqn})
            window = self.view.window()
            dired_view = self.view
            self.focus_other_group(window)
            window.open_file(fqn, sublime.TRANSIENT)
            window.focus_view(dired_view)
        else:
            sublime.status_message(u'File does not exist (%s)' % (basename(fqn.rstrip(os.sep)) or fqn)) 
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:27,代码来源:dired.py

示例7: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self, edit, fname=None):
        path = self.path
        if not fname:
            self.index = self.get_all()
            files = self.get_selected(parent=False)
            fname = join(path, files[0] if files else '')
        else:
            files = True
        p, f  = os.path.split(fname.rstrip(os.sep))

        if not exists(fname):
            return sublime.status_message(u'Directory doesn’t exist “%s”' % path)

        if NT and path == 'ThisPC\\':
            if not ST3:
                fname = fname.encode(locale.getpreferredencoding(False))
            return subprocess.Popen('explorer /select,"%s"' % fname)

        if files:
            self.view.window().run_command("open_dir", {"dir": p, "file": f})
        else:
            self.view.window().run_command("open_dir", {"dir": path}) 
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:24,代码来源:dired_misc.py

示例8: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self, edit, trash=False):
        self.index = self.get_all()
        files = self.get_marked() or self.get_selected(parent=False)
        if not files:
            return sublime.status_message('Nothing chosen')

        msg, trash = self.setup_msg(files, trash)

        emit_event(u'ignore_view', self.view.id(), plugin=u'FileBrowserWFS')
        if trash:
            need_confirm = self.view.settings().get('dired_confirm_send2trash', True)
            msg = msg.replace('Delete', 'Delete to trash', 1)
            if not need_confirm or (need_confirm and sublime.ok_cancel_dialog(msg)):
                self._to_trash(files)
        elif not trash and sublime.ok_cancel_dialog(msg):
            self._delete(files)
        else:
            print("Cancel delete or something wrong in DiredDeleteCommand")
        emit_event(u'watch_view', self.view.id(), plugin=u'FileBrowserWFS') 
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:21,代码来源:dired_file_operations.py

示例9: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self, edit):
        self.edit = edit
        self.prompt_region = Region(0, self.view.size())
        content, path, prefix = self.get_content()
        if not valid(path or content):
            return

        completions, error = self.get_completions(path, prefix)
        if error:
            return  # content of path is unavailable (access, permission, etc.)
        if not completions:
            return sublime.status_message('No matches')

        new_content = self.get_new_content(path, prefix, completions)

        if new_content:
            self.fill_prompt(new_content)
        else:
            self.completions = completions
            self._path = path
            self.w = self.view.window() or sublime.active_window()
            return self.w.show_quick_panel(completions, self.on_done) 
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:24,代码来源:prompt.py

示例10: show_output_panel

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def show_output_panel(self, text):
        if self.silent:
            self.status_message(text)
            return

        if self.results_in_new_tab:
            new_tab_path = os.path.join(self.gulp_results_path(), "Gulp Results")
            self.output_view = self.window.open_file(new_tab_path)
            self.output_view.set_scratch(True)
        else:
            self.output_view = self.window.get_output_panel("gulp_output")
            self.show_panel()

        self.output_view.settings().set("scroll_past_end", False)
        self.add_syntax()
        self.append_to_output_view(text) 
开发者ID:nicosantangelo,项目名称:sublime-gulp,代码行数:18,代码来源:base_command.py

示例11: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self, i):
        if self.stopped:
            return

        before = i % self.size
        after = (self.size - 1) - before

        sublime.status_message('%s [%s=%s]' % (self.message, ' ' * before, ' ' * after))

        if not after:
            self.addend = -1
        if not before:
            self.addend = 1
        i += self.addend

        sublime.set_timeout(lambda: self.run(i), 100) 
开发者ID:nicosantangelo,项目名称:sublime-gulp,代码行数:18,代码来源:progress_notifier.py

示例12: progress_indicator

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def progress_indicator(self, thread, i=0, direction=1):
        if thread.is_alive():
            before = i % 8
            after = (7) - before
            if not after:
                direction = -1
            if not before:
                direction = 1
            i += direction
            self.view.set_status('glue_status_indicator', 'Glue: Running command [%s|%s]' % (' ' * before, ' ' * after))
            sublime.set_timeout(lambda: self.progress_indicator(thread, i, direction), 75)
            return
        else:
            self.view.erase_status('glue_status_indicator')
            sublime.status_message('Glue: Command completed.')

    #------------------------------------------------------------------------------
    # [ execute_command method ] - execute a system command
    #   run in a separate thread from muterun() method above
    #   assigns stdout stderr and exitcode in instance attributes
    #------------------------------------------------------------------------------ 
开发者ID:chrissimpkins,项目名称:glue,代码行数:23,代码来源:Glue.py

示例13: run_file

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run_file(self, options=None):
        if options is None:
            options = {}

        file = self.view.file_name()
        if not file:
            return status_message('PHPUnit: not a test file')

        if has_test_case(self.view):
            self.run(file=file, options=options)
        else:
            find_switchable(
                self.view,
                on_select=lambda switchable: self.run(
                    file=switchable.file,
                    options=options
                )
            ) 
开发者ID:gerardroche,项目名称:sublime-phpunit,代码行数:20,代码来源:plugin.py

示例14: run_nearest

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run_nearest(self, options):
        file = self.view.file_name()
        if not file:
            return status_message('PHPUnit: not a test file')

        if has_test_case(self.view):
            if 'filter' not in options:
                selected_test_methods = find_selected_test_methods(self.view)
                if selected_test_methods:
                    options['filter'] = build_filter_option_pattern(selected_test_methods)

            self.run(file=file, options=options)
        else:
            find_switchable(
                self.view,
                on_select=lambda switchable: self.run(
                    file=switchable.file,
                    options=options
                )
            ) 
开发者ID:gerardroche,项目名称:sublime-phpunit,代码行数:22,代码来源:plugin.py

示例15: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import status_message [as 别名]
def run(self,edit):
		setvars()
		server=settings.get("Server")
		startCmd = ["hugo", "server"]
		if server["THEME_FLAG"]:
			startCmd = startCmd + ["--theme={}".format(server["THEME"])]
		if server["DRAFTS_FLAG"]:
			startCmd = startCmd + ["--buildDrafts"]

		startCmd = startCmd + ["--watch", "--port={}".format(server["PORT"])] 

		try:
			out=subprocess.Popen(startCmd,stderr=subprocess.STDOUT,universal_newlines=True)
			sublime.status_message('Server Started: {}'.format(startCmd))
		except:
			sublime.error_message("Error starting server") 
开发者ID:akmittal,项目名称:Hugofy-sublime,代码行数:18,代码来源:Hugofy.py


注:本文中的sublime.status_message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。