• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sublime.status_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: WarnUser

def WarnUser(message):
    perforce_settings = sublime.load_settings('Perforce.sublime-settings')
    if(perforce_settings.get('perforce_warnings_enabled')):
        if(perforce_settings.get('perforce_log_warnings_to_status')):
            sublime.status_message("Perforce [warning]: {0}".format(message))
        else:
            print("Perforce [warning]: {0}".format(message))
开发者ID:ericmartel,项目名称:Sublime-Text-3-Perforce-Plugin,代码行数:7,代码来源:Perforce.py


示例2: run_command

    def run_command(self, command, callback=None, show_status=True, filter_empty_args=True, no_save=False, **kwargs):
        if filter_empty_args:
            command = [arg for arg in command if arg]
        if "working_dir" not in kwargs:
            kwargs["working_dir"] = self.get_working_dir()
        if (
            "fallback_encoding" not in kwargs
            and self.active_view()
            and self.active_view().settings().get("fallback_encoding")
        ):
            kwargs["fallback_encoding"] = (
                self.active_view().settings().get("fallback_encoding").rpartition("(")[2].rpartition(")")[0]
            )

        s = sublime.load_settings("Git.sublime-settings")
        if s.get("save_first") and self.active_view() and self.active_view().is_dirty() and not no_save:
            self.active_view().run_command("save")
        if command[0] == "git" and s.get("git_command"):
            command[0] = s.get("git_command")
        if command[0] == "git-flow" and s.get("git_flow_command"):
            command[0] = s.get("git_flow_command")
        if not callback:
            callback = self.generic_done

        thread = CommandThread(command, callback, **kwargs)
        thread.start()

        if show_status:
            message = kwargs.get("status_message", False) or " ".join(command)
            sublime.status_message(message)
开发者ID:seancojr,项目名称:sublime-text-2-git,代码行数:30,代码来源:git.py


示例3: run

 def run(self, dirs):
     if sublime.ok_cancel_dialog("Delete Folder?", "Delete"):
         try:
             for d in dirs:
                 send2trash.send2trash(d)
         except:
             sublime.status_message("Unable to delete folder")
开发者ID:40a,项目名称:Chocolatey-Packages,代码行数:7,代码来源:side_bar.py


示例4: run_command

    def run_command(self, command, callback=None, show_status=True,
            filter_empty_args=True, no_save=False, **kwargs):
        if filter_empty_args:
            command = [arg for arg in command if arg]
        if 'working_dir' not in kwargs:
            kwargs['working_dir'] = self.get_working_dir()
        if 'fallback_encoding' not in kwargs and self.active_view() and self.active_view().settings().get('fallback_encoding'):
            kwargs['fallback_encoding'] = self.active_view().settings().get('fallback_encoding').rpartition('(')[2].rpartition(')')[0]

        s = sublime.load_settings("Git.sublime-settings")
        if s.get('save_first') and self.active_view() and self.active_view().is_dirty() and not no_save:
            self.active_view().run_command('save')
        if command[0] == 'git' and s.get('git_command'):
            command[0] = s.get('git_command')
        if command[0] == 'git-flow' and s.get('git_flow_command'):
            command[0] = s.get('git_flow_command')
        if not callback:
            callback = self.generic_done

        thread = CommandThread(command, callback, **kwargs)
        thread.start()

        if show_status:
            message = kwargs.get('status_message', False) or ' '.join(command)
            sublime.status_message(message)
开发者ID:1st1,项目名称:sublime-text-2-git,代码行数:25,代码来源:git.py


示例5: run_async

    def run_async(self):
        short_hash = self.get_selected_short_hash()
        if not short_hash:
            return
        if self.interface.entries[-1].short_hash == short_hash:
            sublime.status_message("Unable to move last commit down.")
            return

        commit_chain = [
            self.ChangeTemplate(orig_hash=entry.long_hash,
                                move=entry.short_hash == short_hash,
                                do_commit=True,
                                msg=entry.raw_body,
                                datetime=entry.datetime,
                                author="{} <{}>".format(entry.author, entry.email))
            for entry in self.interface.entries
        ]

        # Take the change to move and swap it with the one following.
        for idx, commit in enumerate(commit_chain):
            if commit.move:
                commit_chain[idx], commit_chain[idx+1] = commit_chain[idx+1], commit_chain[idx]
                break

        try:
            self.make_changes(commit_chain)
        except:
            sublime.message_dialog("Unable to move commit, most likely due to a conflict.")
开发者ID:NiksonX,项目名称:GitSavvy,代码行数:28,代码来源:rebase.py


示例6: plugin_loaded

def plugin_loaded():
    if DEBUG:
        UTC_TIME = datetime.utcnow()
        PYTHON = sys.version_info[:3]
        VERSION = sublime.version()
        PLATFORM = sublime.platform()
        ARCH = sublime.arch()
        PACKAGE = sublime.packages_path()
        INSTALL = sublime.installed_packages_path()

        message = (
            'Jekyll debugging mode enabled...\n'
            '\tUTC Time: {time}\n'
            '\tSystem Python: {python}\n'
            '\tSystem Platform: {plat}\n'
            '\tSystem Architecture: {arch}\n'
            '\tSublime Version: {ver}\n'
            '\tSublime Packages Path: {package}\n'
            '\tSublime Installed Packages Path: {install}\n'
        ).format(time=UTC_TIME, python=PYTHON, plat=PLATFORM, arch=ARCH,
                 ver=VERSION, package=PACKAGE, install=INSTALL)

        sublime.status_message('Jekyll: Debugging enabled...')
        debug('Plugin successfully loaded.', prefix='\n\nJekyll', level='info')
        debug(message, prefix='Jekyll', level='info')
开发者ID:nighthawk,项目名称:sublime-jekyll,代码行数:25,代码来源:jekyll.py


示例7: on_done_filename

    def on_done_filename(self, value):
        self.filename = value
        # get selected text, or the whole file if nothing selected
        if all([region.empty() for region in self.view.sel()]):
            text = self.view.substr(sublime.Region(0, self.view.size()))
        else:
            text = "\n".join([self.view.substr(region) for region in self.view.sel()])

        try:
            gist = self.gistapi.create_gist(description=self.description,
                                            filename=self.filename,
                                            content=text,
                                            public=self.public)
            self.view.settings().set('gist', gist)
            sublime.set_clipboard(gist["html_url"])
            sublime.status_message(self.MSG_SUCCESS)
        except GitHubApi.UnauthorizedException:
            # clear out the bad token so we can reset it
            self.settings.set("github_token", "")
            sublime.save_settings("GitHub.sublime-settings")
            sublime.error_message(self.ERR_UNAUTHORIZED_TOKEN)
            sublime.set_timeout(self.get_username, 50)
        except GitHubApi.UnknownException as e:
            sublime.error_message(e.message)
        except GitHubApi.ConnectionException as e:
            sublime.error_message(e.message)
开发者ID:Mikerobenics,项目名称:sublime-github,代码行数:26,代码来源:sublime_github.py


示例8: on_filename

 def on_filename(filename):
     if filename:
         text = self.view.substr(sublime.Region(0, self.view.size()))
         changes = {filename: {'content': text}}
         new_gist = update_gist(gist['url'], changes)
         gistify_view(self.view, new_gist, filename)
         sublime.status_message("File added to Gist")
开发者ID:Fhoerth,项目名称:Sublime-Text-2-Plugins---Settings,代码行数:7,代码来源:gist.py


示例9: run

 def run(self, **args):
     config = getPrefs(args["cmd"])
     if config != None:
         if (len(config) > 0):
             if args.get("batch", False) == True or (config.get("debug", None) != None and "all" in config["debug"] or "a" in config["debug"]):
                 args["cmd"] = [config["compiler"], config["filedir"]]
                 if config.get("scripts", None) != None:
                     if config["filedir"] == config["scripts"]:
                         if USER_SETTINGS.get("confirm_dangerous_batch_compilations", True) == True:
                             if not sublime.ok_cancel_dialog("Are you sure you want to batch compile all script sources in \"%s\"?\n\nThis folder may contain script sources that are supplied with Creation Kit and are a part of the base game. Compiling said script sources could lead to unintended behavior if they have been modified." % config["filedir"]):
                                 return
             else:
                 args["cmd"] = [config["compiler"], config["filename"]]
             args["cmd"].append("-f=%s" % config["flags"])
             args["cmd"].append("-i=%s" % config["import"])
             args["cmd"].append("-o=%s" % config["output"])
             for debugarg in config["debug"]:
                 if debugarg.startswith("-"):
                     args["cmd"].append("%s" % debugarg)
                 else:
                     args["cmd"].append("-%s" % debugarg)
             if args.get("batch", False) == True:
                 if config.get("debug", None) != None or ("all" not in config["debug"] and "a" not in config["debug"]):
                     args["cmd"].append("-all")
                 del args["batch"]
             args["working_dir"] = os.path.dirname(config["compiler"])
             self.window.run_command("exec", args)
         else:
             sublime.status_message("No configuration for %s" % os.path.dirname(args["cmd"]))
开发者ID:Scrivener07,项目名称:SublimePapyrus,代码行数:29,代码来源:SublimePapyrus.py


示例10: on_gist_filename

            def on_gist_filename(filename):
                # We need to figure out the filenames. Right now, the following logic is used:
                #   If there's only 1 selection, just pass whatever the user typed to Github. It'll rename empty files for us.
                #   If there are multiple selections and user entered a filename, rename the files from foo.js to
                #       foo (1).js, foo (2).js, etc.
                #   If there are multiple selections and user didn't enter anything, post the files as
                #       $SyntaxName 1, $SyntaxName 2, etc.
                if len(region_data) == 1:
                    gist_data = {filename: region_data[0]}
                else:
                    if filename:
                        (namepart, extpart) = os.path.splitext(filename)
                        make_filename = lambda num: "%s (%d)%s" % (namepart, num, extpart)
                    else:
                        syntax_name, _ = os.path.splitext(os.path.basename(self.view.settings().get('syntax')))
                        make_filename = lambda num: "%s %d" % (syntax_name, num)
                    gist_data = dict((make_filename(idx), data) for idx, data in enumerate(region_data, 1))

                gist = create_gist(self.public, description, gist_data)

                gist_html_url = gist['html_url']
                sublime.set_clipboard(gist_html_url)
                sublime.status_message("%s Gist: %s" % (self.mode(), gist_html_url))

                if gistify:
                    gistify_view(self.view, gist, gist['files'].keys()[0])
开发者ID:Fhoerth,项目名称:Sublime-Text-2-Plugins---Settings,代码行数:26,代码来源:gist.py


示例11: run

 def run(self, edit, command, options=None, text=None, separator=None):
     try:
         cmd = Command.create(command, options)
         if cmd:
             items = None
             if text: items = text.split(separator)
             cmd.init(self.view, items)
             regions = []
             sel = self.view.sel()
             last_region = None
             for region in sel:
                 if cmd.has_next():
                     value = cmd.next()
                     if value is not None:
                         self.view.replace(edit, region, value)
                         regions.append(region)
                 else:
                     break
             for region in regions:
                 sel.subtract(region)
         else:
             sublime.status_message("Command not found: " + cmd)
     except ValueError:
         sublime.status_message("Error while executing Text Pastry, canceled")
         pass
开发者ID:adzenith,项目名称:Text-Pastry,代码行数:25,代码来源:text_pastry.py


示例12: handle_threads

  def handle_threads(self, edit, threads, offset=0, i=0, dir=1):
    next_threads = []
    for thread in threads:
      if thread.is_alive():
        next_threads.append(thread)
        continue
      if thread.result == False:
        continue
      offset = self.replace(edit, thread, offset)

    threads = next_threads

    if len(threads):
      # This animates a little activity indicator in the status area
      before = i % 8
      after = (7) - before
      if not after:
        dir = -1
      if not before:
        dir = 1
      i += dir
      self.view.set_status('bitly', 'Bitly [%s=%s]' % (' ' * before, ' ' * after))

      sublime.set_timeout(lambda: self.handle_threads(edit, threads, offset, i, dir), 100)
      return

    self.view.end_edit(edit)

    self.view.erase_status('bitly')
    matches = len(self.urls)
    sublime.status_message('Bitly successfully run on %s selection%s' % (matches, '' if matches == 1 else 's'))
开发者ID:the0ther,项目名称:Sublime-Bitly,代码行数:31,代码来源:Bitly.py


示例13: on_post_save

    def on_post_save(self, view):
        dir = view.window().folders()
        title = "ThinkPHP-CLI.html"
        title2 = "ThinkPHP-Queryer"
        content = view.substr(sublime.Region(0, view.size()))
        global seperator
        if dir == []:
            if view.file_name().find(title) != -1:
                sublime.status_message('Please open a folder')
        else:
            if view.file_name().find(title) != -1:
                query = content.split(seperator)
                cmd = query[0]
                command_text = ['php', dir[0] + os.sep + 'index.php', cmd]
                thread = cli(command_text,view,dir[0])
                thread.start()
                ThreadProgress(thread, 'Is excuting', 'cli excuted')

        if view.file_name().find(title2) != -1:
            sql = content
            if sql == '':
                sublime.status_message('Pls input correct sql')
            else:
                command_text = 'php "' + packages_path + os.sep + 'command.php" "query"'
                cloums = os.popen(command_text)
                data = cloums.read()
                self.window = view.window()
                show_outpanel(self, 'ThinkPHP-Queryer', data , True)
开发者ID:qeyser,项目名称:SublimeThinkPHP,代码行数:28,代码来源:Thinkphp.py


示例14: run

  def run(self, edit):
    paths = getPaths(self)

    if len(paths[2]) != 0 and len(paths[3]) != 0:
      command = ['/Users/kyleg/bin/push', paths[2]]
      simpleShellExecute(command, paths[3])
      sublime.status_message("Pushed %s from %s" % (paths[2], paths[3]))
开发者ID:TiE23,项目名称:fast-push,代码行数:7,代码来源:FastPush.py


示例15: run

    def run(self, *args, **kwargs):
        try:
            # The first folder needs to be the Laravel Project
            self.PROJECT_PATH = self.window.folders()[0]
            artisan_path = os.path.join(self.PROJECT_PATH, self.artisan_path)
            self.args = [self.php_path, artisan_path]

            if os.path.isfile("%s" % artisan_path):
                self.command = kwargs.get('command', None)
                if self.command == 'serveStop':
                    plat = platform.system()
                    if plat == 'Windows':
                        self.command = 'taskkill /F /IM php.exe'
                    else:
                        self.command = 'killall php'
                    self.args = []
                else:
                    self.args = [self.php_path, artisan_path]
                self.fill_in_accept = kwargs.get('fill_in', False)
                self.fill_in_label = kwargs.get('fill_in_lable', 'Enter the resource name')
                self.fields_accept = kwargs.get('fields', False)
                self.fields_label = kwargs.get('fields_label', 'Enter the fields')
                if self.command is None:
                    self.window.show_input_panel('Command name w/o args:', '', self.on_command_custom, None, None)
                else:
                    self.on_command(self.command)
            else:
                sublime.status_message("Artisan not found")
        except IndexError:
            sublime.status_message("Please open a Laravel Project")
开发者ID:filipac,项目名称:Laravel-4-Artisan,代码行数:30,代码来源:Laravel+4+Artisan.py


示例16: status_done

 def status_done(self, result):
     self.results = filter(lambda x: len(x) > 0 and not x.lstrip().startswith('>'),
         result.rstrip().split('\n'))
     if len(self.results):
         self.show_status_list()
     else:
         sublime.status_message("Nothing to show")
开发者ID:ntcong,项目名称:sublime-text-2-config,代码行数:7,代码来源:Modific.py


示例17: open_in_browser

    def open_in_browser(cls, path, browser="default"):
        if browser == "default":
            if sys.platform == "darwin":
                # To open HTML files, Mac OS the open command uses the file
                # associated with .html. For many developers this is Sublime,
                # not the default browser. Getting the right value is
                # embarrassingly difficult.
                import shlex
                import subprocess

                env = {"VERSIONER_PERL_PREFER_32_BIT": "true"}
                raw = """perl -MMac::InternetConfig -le 'print +(GetICHelper "http")[1]'"""
                process = subprocess.Popen(shlex.split(raw), env=env, stdout=subprocess.PIPE)
                out, err = process.communicate()
                default_browser = out.strip().decode("utf-8")
                cmd = "open -a '%s' %s" % (default_browser, path)
                os.system(cmd)
            else:
                desktop.open(path)
            sublime.status_message("Markdown preview launched in default browser")
        else:
            cmd = '"%s" %s' % (browser, path)
            if sys.platform == "darwin":
                cmd = "open -a %s" % cmd
            elif sys.platform == "linux2":
                cmd += " &"
            elif sys.platform == "win32":
                cmd = 'start "" %s' % cmd
            result = os.system(cmd)
            if result != 0:
                sublime.error_message('cannot execute "%s" Please check your Markdown Preview settings' % browser)
            else:
                sublime.status_message("Markdown preview launched in %s" % browser)
开发者ID:kinjo1506,项目名称:sublimetext-markdown-preview,代码行数:33,代码来源:MarkdownPreview.py


示例18: on_done

 def on_done(self, idx):
     if idx == -1:
         return
     gist = self.gists[idx]
     filename = list(gist["files"].keys())[0]
     filedata = gist["files"][filename]
     content = self.gistapi.get(filedata["raw_url"])
     if self.open_in_editor:
         new_view = self.view.window().new_file()
         if expat:  # not present in Linux
             # set syntax file
             if not self.syntax_file_map:
                 self.syntax_file_map = self._generate_syntax_file_map()
             try:
                 extension = os.path.splitext(filename)[1][1:].lower()
                 syntax_file = self.syntax_file_map[extension]
                 new_view.set_syntax_file(syntax_file)
             except KeyError:
                 logger.warn("no mapping for '%s'" % extension)
                 pass
         # insert the gist
         new_view.run_command("insert_text", {'text': content})
         new_view.set_name(filename)
         new_view.settings().set('gist', gist)
     elif self.copy_gist_id:
         sublime.set_clipboard(gist["html_url"])
     else:
         sublime.set_clipboard(content)
         sublime.status_message(self.MSG_SUCCESS % filename)
开发者ID:Mikerobenics,项目名称:sublime-github,代码行数:29,代码来源:sublime_github.py


示例19: parser_specific_convert

    def parser_specific_convert(self, markdown_text):
        import subprocess

        binary = self.settings.get("multimarkdown_binary", "")
        if os.path.exists(binary):
            cmd = [binary]
            critic_mode = self.settings.get("strip_critic_marks", "accept")
            if critic_mode in ("accept", "reject"):
                cmd.append("-a" if critic_mode == "accept" else "-r")
            sublime.status_message("converting markdown with multimarkdown...")
            if sublime.platform() == "windows":
                startupinfo = subprocess.STARTUPINFO()
                startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
                p = subprocess.Popen(
                    cmd, startupinfo=startupinfo, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE
                )
            else:
                p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            for line in markdown_text.split("\n"):
                p.stdin.write((line + "\n").encode("utf-8"))
            markdown_html = p.communicate()[0].decode("utf-8")
            if p.returncode:
                # Log info to console
                sublime.error_message("Could not convert file! See console for more info.")
                print(markdown_html)
                markdown_html = _CANNOT_CONVERT
        else:
            sublime.error_message("Cannot find multimarkdown binary!")
            markdown_html = _CANNOT_CONVERT
        return markdown_html
开发者ID:kinjo1506,项目名称:sublimetext-markdown-preview,代码行数:30,代码来源:MarkdownPreview.py


示例20: show_in_quick_panel

 def show_in_quick_panel(self, result):
     self.results = list(result.rstrip().split('\n'))
     if len(self.results):
         self.quick_panel(self.results,
             self.do_nothing, sublime.MONOSPACE_FONT)
     else:
         sublime.status_message("Nothing to show")
开发者ID:Rolling913,项目名称:sublime-text-git,代码行数:7,代码来源:core.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sublime.version函数代码示例发布时间:2022-05-27
下一篇:
Python sublime.set_timeout_async函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap