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

Python sublime.message_dialog函数代码示例

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

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



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

示例1: run

	def run(self, edit):		
		sels = self.view.sel()		
		if self.isRegionEmpty(sels[0]):
			sublime.message_dialog("Please select list by pressing ctrl+A")
		else:
			if self.convertListTocsv(sels,edit) =="true":
				sublime.status_message("Conversion Done")
开发者ID:avinash8526,项目名称:List2CSV-Sublime-Plugin,代码行数:7,代码来源:list2csv.py


示例2: popup_error_list

    def popup_error_list(self):
        """ Display a popup list of the errors found """
        view_id = self.view.id()

        if not view_id in PYLINTER_ERRORS:
            return

        # No errors were found
        if len(PYLINTER_ERRORS[view_id]) == 1:
            sublime.message_dialog("No Pylint errors found")
            return

        errors = [(key + 1, value)
                  for key, value in PYLINTER_ERRORS[view_id].items()
                  if key != 'visible']
        line_nums, panel_items = zip(*sorted(errors,
                                             key=lambda error: error[1]))

        def on_done(selected_item):
            """ Jump to the line of the item that was selected from the list """
            if selected_item == -1:
                return
            self.view.run_command("goto_line",
                                  {"line": line_nums[selected_item]})

        self.view.window().show_quick_panel(list(panel_items), on_done)
开发者ID:Mondego,项目名称:pyreco,代码行数:26,代码来源:allPythonContent.py


示例3: handler

 def handler(self, name, data):
     if name == 'create_user':
         del data['name']
         try:
             floorc = BASE_FLOORC + '\n'.join(['%s %s' % (k, v) for k, v in data.items()]) + '\n'
             with open(G.FLOORC_PATH, 'wb') as floorc_fd:
                 floorc_fd.write(floorc.encode('utf-8'))
             utils.reload_settings()
             if False in [bool(x) for x in (G.USERNAME, G.API_KEY, G.SECRET)]:
                 sublime.message_dialog('Something went wrong. You will need to sign up for an account to use Floobits.')
                 api.send_error({'message': 'No username or secret'})
             else:
                 p = os.path.join(G.BASE_DIR, 'welcome.md')
                 with open(p, 'wb') as fd:
                     text = welcome_text % (G.USERNAME, self.host)
                     fd.write(text.encode('utf-8'))
                 d = utils.get_persistent_data()
                 d['auto_generated_account'] = True
                 utils.update_persistent_data(d)
                 G.AUTO_GENERATED_ACCOUNT = True
                 sublime.active_window().open_file(p)
         except Exception as e:
             msg.error(e)
         try:
             d = utils.get_persistent_data()
             d['disable_account_creation'] = True
             utils.update_persistent_data(d)
         finally:
             self.stop()
开发者ID:chenkaigithub,项目名称:floobits-sublime,代码行数:29,代码来源:agent_connection.py


示例4: extract

 def extract(self):
   sep = os.sep
   if self.NODE_JS_TAR_EXTENSION != ".zip" :
     with tarfile.open(self.NODE_JS_BINARY_TARFILE_FULL_PATH, "r:gz") as tar :
       for member in tar.getmembers() :
         member.name = sep.join(member.name.split(sep)[1:])
         tar.extract(member, node_variables.NODE_JS_BINARIES_FOLDER_PLATFORM)
   else :
     if node_variables.NODE_JS_OS == "win" :
       import string
       from ctypes import windll, c_int, c_wchar_p
       UNUSUED_DRIVE_LETTER = ""
       for letter in string.ascii_uppercase:
         if not os.path.exists(letter+":") :
           UNUSUED_DRIVE_LETTER = letter+":"
           break
       if not UNUSUED_DRIVE_LETTER :
         sublime.message_dialog("Can't install node.js and npm! UNUSUED_DRIVE_LETTER not found.")
         return
       DefineDosDevice = windll.kernel32.DefineDosDeviceW
       DefineDosDevice.argtypes = [ c_int, c_wchar_p, c_wchar_p ]
       DefineDosDevice(0, UNUSUED_DRIVE_LETTER, node_variables.NODE_JS_BINARIES_FOLDER_PLATFORM)
       try:
         with zipfile.ZipFile(self.NODE_JS_BINARY_TARFILE_FULL_PATH, "r") as zip_file :
           for member in zip_file.namelist() :
             if not member.endswith("/") :
               with zip_file.open(member) as node_file:
                 with open(UNUSUED_DRIVE_LETTER + "\\"+ member.replace("node-"+self.NODE_JS_VERSION+"-"+node_variables.NODE_JS_OS+"-"+node_variables.NODE_JS_ARCHITECTURE+"/", ""), "wb+") as target :
                   shutil.copyfileobj(node_file, target)
             elif not member.endswith("node-"+self.NODE_JS_VERSION+"-"+node_variables.NODE_JS_OS+"-"+node_variables.NODE_JS_ARCHITECTURE+"/"):
               os.mkdir(UNUSUED_DRIVE_LETTER + "\\"+ member.replace("node-"+self.NODE_JS_VERSION+"-"+node_variables.NODE_JS_OS+"-"+node_variables.NODE_JS_ARCHITECTURE+"/", ""))
       except Exception as e:
         print("Error: "+traceback.format_exc())
       finally:
         DefineDosDevice(2, UNUSUED_DRIVE_LETTER, node_variables.NODE_JS_BINARIES_FOLDER_PLATFORM)
开发者ID:jordanwade,项目名称:dotfiles,代码行数:35,代码来源:installer.py


示例5: getPackageData

    def getPackageData(self):
        window = self.window
        view = window.active_view()
        selText = view.sel()[0]
        xt = str(window.active_view().file_name())

        scope = (view.scope_name(0).split(" ")[0].split(".")[1])
        selected = view.substr(selText)

        try:
            if scope == "java":
                sublime.status_message("LangDocs: Looking up package definition")
                doc = getJavaPackDoc(selected)[0]
                url = getJavaPackDoc(selected)[1]

                if len(doc) > 2:
                    try:
                        doc =  "<h1>%s documentation</h1><br>%s ... <br><br>Read more at: \"<a href=\"%s\">%s</a>\"" % (selected, doc, url, url)
                        view.show_popup("<style>%s</style>%s" % (css, doc), max_width=700,
                            on_navigate=lambda x:(webbrowser.open(url)))

                    except:
                        doc =  "%s documentation\n\n%s ... \n\nRead more at: \"%s\"" % (selected, doc, url)
                        sublime.message_dialog(doc)

                else:
                    sublime.status_message("LangDocs: Can't find documentation")
        except:
            sublime.status_message("LangDocs: Can't find documentation")
开发者ID:tushortz,项目名称:LangDocs,代码行数:29,代码来源:DocsPackage.py


示例6: on_post_save

    def on_post_save(self, view):
        if not self.is_enabled(view):
            return
        compile_on_save = settings_get('compileOnSave', True)
        if compile_on_save is True:
            print("Compiling on save...")
            view.run_command("compile")
            show_compile_output_on_save = settings_get('showOutputOnSave', True)
            if show_compile_output_on_save is True and isCoffee() is True and RunScriptCommand.PANEL_IS_OPEN is True:
                print("Updating output panel...")
                view.run_command("compile_output")

        watch_save = settings_get('watchOnSave', True)
        if watch_save:
            viewID = view.id()
            if viewID in watchers:
                watchers[viewID].refresh()

        if settings_get("checkSyntaxOnSave", True):
            args = ['-b', '-p']
            if isLitCoffee(view):
                args = ['-l'] + args
            res = brew(args, Text.get(view))
            if res["okay"] is True:
                sublime.status_message("Syntax is valid.")
            else:
                status = res["err"].split("\n")[0]
                sublime.message_dialog('Syntax error: %s' % status)

        if settings_get("lintOnSave", True):
            view.run_command("lint")
开发者ID:ehuss,项目名称:sublime-better-coffeescript,代码行数:31,代码来源:CoffeeScript.py


示例7: 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

        move_idx, to_move, entry_before_move = self.get_idx_entry_and_prev(short_hash)

        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[move_idx:]
        ]

        # Take the change to move and swap it with the one following.
        commit_chain[0], commit_chain[1] = commit_chain[1], commit_chain[0]

        try:
            self.make_changes(commit_chain, "moved " + short_hash + " down", entry_before_move.long_hash)
            move_cursor(self.view, 2)
        except:
            sublime.message_dialog("Unable to move commit, most likely due to a conflict.")
开发者ID:aziz,项目名称:GitSavvy,代码行数:28,代码来源:rebase.py


示例8: wrapper

 def wrapper(self):
   try:
     return func(self, self.repository)
   except (NotAGitRepositoryError, NotAGithubRepositoryError):
     sublime.message_dialog("Github repository not found.")
   except (NoFileOpenError):
     sublime.message_dialog("Please open a file first.")
开发者ID:dfarr,项目名称:sublime-github-issues,代码行数:7,代码来源:github.py


示例9: do_create

        def do_create(self):
            if len(self.w.folders()) == 0:
                message = "Ensime project cannot be created, because you either don't have a Sublime project "
                message += "or don't have any folders associated with your Sublime project."
                message += "\n\n"
                message += "To use Ensime you need to have an active non-empty project. "
                message += "Sublime will now try to initialize a project for you. "
                message += "\n\n"
                message += "You will be shown a dialog that will let you select a root folder for the project. "
                message += "After the root folder is selected, Sublime will create a configuration file in it. "
                message += "Do you wish to proceed?"
                if sublime.ok_cancel_dialog(message):
                    self.w.run_command("prompt_add_folder")
                    # if you don't do set_timeout, self.w.folders() won't be updated
                    sublime.set_timeout(self.post_prompt_add_folder, 0)
                    return

            if len(self.w.folders()) > 1:
                message = "A .ensime configuration file needs to be created in one of your project's folders."
                message += "\n\n"
                message += "Since you have multiple folders in the project, pick an appropriate folder in the dialog that will follow."
                sublime.message_dialog(message)

            if (len(self.w.folders())) == 1:
                self.folder_selected(0)
            else:
                self.w.show_quick_panel(self.w.folders(), self.folder_selected)
开发者ID:bartschuller,项目名称:sublime-ensime,代码行数:27,代码来源:dotensime.py


示例10: run

  def run(self, edit):
    super(RubocopAutoCorrectCommand, self).run(edit)

    cancel_op = self.user_wants_to_cancel()
    if cancel_op:
      return

    view = self.view
    path = view.file_name()
    quoted_file_path = FileTools.quote(path)

    if view.is_read_only():
      sublime.message_dialog('RuboCop: Unable to run auto correction on a read only buffer.')
      return

    # Inform user about unsaved contents of current buffer
    if view.is_dirty():
      warn_msg = 'RuboCop: The curent buffer is modified. Save the file and continue?'
      cancel_op = not sublime.ok_cancel_dialog(warn_msg)

    if cancel_op:
      return
    else:
      view.run_command('save')

    RubocopEventListener.instance().clear_marks(view)

    quoted_file_path = FileTools.quote(path)

    # Run rubocop with auto-correction
    self.runner.run(quoted_file_path, '-a')

    sublime.status_message('RuboCop: Auto correction done.')
开发者ID:ayonkhan,项目名称:sublime_rubocop,代码行数:33,代码来源:rubocop_command.py


示例11: __init__

	def __init__(self, subl_args, curdir, sdk_path, private_key):
		super(CommandBuilder, self).__init__()
		self.curdir = curdir
		self.sdk_path = sdk_path
		self.private_key = private_key
		self.args = subl_args

		self.flags = subl_args["flags"] if "flags" in subl_args else []
		self.device = subl_args["device"] if "device" in subl_args and subl_args["device"] != "prompt" else False
		self.do = subl_args["do"] if "do" in subl_args else "build"

		if "sdk" in subl_args:
			target_sdks = SDK(sdk_path).targetSDKs()
			match = [x for x in target_sdks if subl_args["sdk"].replace(".x","") == ".".join(x.split(".")[:2])]
			if len(match):
				self.sdk = match[0]
			else:
				self.sdk = False
				sublime.message_dialog("unsupported SDK target: {}".format(subl_args["sdk"],))
		else:
			self.sdk = False

		# apps compile with monkeyc, barrels(modules) with barrelbuild
		# so we need to know which we are dealing with
		self.build_for = self.detect_app_vs_barrel()
开发者ID:pzl,项目名称:Sublime-MonkeyC,代码行数:25,代码来源:run.py


示例12: run

    def run(self, edit, action='compact'):
        # Format all the code
        if re.match(r'.*\.css$', self.view.file_name())  :
            regx = '\}[ \t]*(?=[^\n]\S)|\}\s+(?=\n)'
            rules1 = self.view.find_all(regx)
            for x in rules1:
                self.view.replace(edit, self.view.find(regx, x.a), "}\n")
        # Format all the code End

        rule_starts = self.view.find_all('\{')
        rule_ends = self.view.find_all('\}')

        if len(rule_starts) != len(rule_ends):
            sublime.message_dialog("value not match!")
            return

        area = Ele.getArea(rule_starts, rule_ends)

        rules_regions = list()
        regions_to_process = list()

        selections = self.view.sel()
        if len(selections) == 1 and selections[0].empty():
            selections = [sublime.Region(0, self.view.size())]

        for i in range(len(area)):
            rule_region = area[i]
            rules_regions.append(rule_region)
            for sel in selections:
                if sel.intersects(rule_region):
                    regions_to_process.append(rule_region)
                    break

        regions_to_process.reverse()
        self.process_rules_regions(regions_to_process, action, edit)
开发者ID:TooBug,项目名称:CompactExpandCss,代码行数:35,代码来源:compactExpandCssCommand.py


示例13: run

 def run(self):
     listitems = []
     self.nodes = []
     labels = []
     label_ids = []
     regexs = [r"\$LOCALIZE\[([0-9].*?)\]", r"\$ADDON\[.*?([0-9].*?)\]", r"(?:label|property|altlabel|label2)>([0-9].*?)<"]
     view = self.window.active_view()
     path = view.file_name()
     for po_file in INFOS.po_files:
         labels += [s.msgid for s in po_file]
         label_ids += [s.msgctxt for s in po_file]
     # view.substr(sublime.Region(0, view.size()))
     with open(path, encoding="utf8") as f:
         for i, line in enumerate(f.readlines()):
             for regex in regexs:
                 for match in re.finditer(regex, line):
                     label_id = "#" + match.group(1)
                     if label_id in label_ids:
                         index = label_ids.index(label_id)
                         listitems.append("%s (%s)" % (labels[index], label_id))
                     node = {"file": path,
                             "line": i + 1}
                     self.nodes.append(node)
     if listitems:
         self.window.show_quick_panel(listitems, lambda s: self.on_done(s), selected_index=0, on_highlight=lambda s: self.show_preview(s))
     else:
         sublime.message_dialog("No references found")
开发者ID:ertos12,项目名称:SublimeKodi,代码行数:27,代码来源:sublimekodi.py


示例14: delayed_settings_restore

            def delayed_settings_restore():
                if type == 'upgrade' and package in self.old_syntaxes:
                    for view_syntax in self.old_syntaxes[package]:
                        view, syntax = view_syntax
                        view.settings().set('syntax', syntax)

                if type == 'upgrade' and package in self.old_color_schemes:
                    for view_scheme in self.old_color_schemes[package]:
                        view, scheme = view_scheme
                        view.settings().set('color_scheme', scheme)

                if type == 'upgrade' and self.old_theme_package == package:
                    settings.set('theme', self.old_theme)
                    sublime.message_dialog(text.format(
                        u'''
                        Package Control

                        Your active theme was just upgraded. You may see some
                        graphical corruption until you restart Sublime Text.
                        '''
                    ))

                if type == 'upgrade' and self.old_color_scheme_package == package:
                    settings.set('color_scheme', self.old_color_scheme)

                sublime.save_settings(preferences_filename())
开发者ID:autumnViolet,项目名称:package_control,代码行数:26,代码来源:package_disabler.py


示例15: show_results

    def show_results(self, search_value=''):
        # TODO: paging?
        if search_value:
            search_result = self.do_search(search_value)

        if search_result:

            text = ''
            while True:
                try:
                    hit = search_result.next()
                    if hit:
                        text += self.get_block(hit)
                except StopIteration:
                    break

            if text:
                self.view = sublime.active_window().new_file()
                # TODO: view set attrs in utils..
                syntax_file = mw.get_setting('syntax')
                self.view.set_syntax_file(syntax_file)
                self.view.set_name('Wiki search results: %s' % search_value)
                self.view.run_command(mw.cmd('insert_text'), {'position': 0, 'text': text})
            elif search_value:
                sublime.message_dialog('No results for: %s' % search_value)
开发者ID:rabin-io,项目名称:Mediawiker,代码行数:25,代码来源:mw_search_string.py


示例16: create_output

    def create_output(self):
        self.sourceFilePath = self.inputView.file_name()
        self.outputFileName = Tool.get_js_file_name(Tool.get_file_name(self.sourceFilePath))
        self.outputTempDir = tempfile.gettempdir()
        # print(self.outputTempDir)
        self.outputFilePath = path.join(self.outputTempDir, self.outputFileName)

        no_wrapper = settings_get('noWrapper', True)
        args = []
        if no_wrapper:
            args = ['-b'] + args
        args = args + ["-m", "-o", self.outputTempDir, self.sourceFilePath]

        res = run("coffee", args)
        if not res["okay"]:
            sublime.message_dialog("Error. See console.")
            print(res["err"])
            return
        # create new tab
        self.outputView = self.inputView.window().open_file(self.outputFilePath)
        # move it to second column
        self.outputView.window().focus_group(1)
        self.outputView.window().set_view_index(self.outputView, self.outputView.window().active_group(), 0)
        # self.outputView.window().focus_group(0)
        self.inputView.window().focus_view(self.inputView)
开发者ID:ehuss,项目名称:sublime-better-coffeescript,代码行数:25,代码来源:CoffeeScript.py


示例17: launch_simulator

def launch_simulator(file_name):
	QUICK_V3_ROOT = _find_environment_variable("QUICK_V3_ROOT")
	if QUICK_V3_ROOT == None:
		sublime.message_dialog("please set environment variable 'QUICK_V3_ROOT'")
		return

	WORKDIR = get_workdir(file_name)
	if WORKDIR == None: return

	BIN = ""
	ARG = " -workdir %s -search-path %s/quick" % (WORKDIR, QUICK_V3_ROOT)

	def _windows():
		os.system("taskkill /F /IM simulator.exe")
		return QUICK_V3_ROOT + "/tools/simulator/runtime/win32/simulator.exe"

	def _mac():
		os.system("ps -x|grep simulator|xargs kill -9")
		# os.system("open /Applications/Xcode.app")
#       QUICK_V3_ROOT + "/tools/simulator/runtime/mac/Simulator.app/Contents/MacOS/Simulator"
#       "/Users/liangxie/Desktop/work/qgl/frameworks/cocos2d-x/tools/simulator/runtime/mac/Simulator.app/Contents/MacOS/Simulator"
		return QUICK_V3_ROOT + "/tools/simulator/runtime/mac/Simulator.app/Contents/MacOS/Simulator"
#        return QUICK_V3_ROOT + "../Desktop/work/qgl/runtime/mac/qgl Mac.app/Contents/MacOS/qgl Mac"


	if _isWindows():
		BIN = _windows()
	if _is_mac(): 
		BIN = _mac()
	# if _isLinux(): _linux()

	sublime.set_timeout_async(lambda:os.system(BIN + ARG), 0)
开发者ID:liangxiegame,项目名称:SublimeQuickSimulator,代码行数:32,代码来源:RunQuickSimulator.py


示例18: make_changes

    def make_changes(self, commit_chain, description, base_commit=None):
        base_commit = base_commit or self.interface.base_commit()
        branch_name, ref, changed_files = self.interface.get_branch_state()
        success = True

        if len(changed_files):
            sublime.message_dialog(
                "Unable to perform rebase actions while repo is in unclean state."
            )
            return

        try:
            self.rewrite_active_branch(
                base_commit=base_commit,
                commit_chain=commit_chain
                )

        except Exception as e:
            success = False
            raise e

        finally:
            self.interface.complete_action(branch_name, ref, success, description)

        util.view.refresh_gitsavvy(self.view)
开发者ID:aziz,项目名称:GitSavvy,代码行数:25,代码来源:rebase.py


示例19: select

    def select(self, item):
        """Select action to perform."""

        if "action" in item:
            if item['action'] == "fold":
                self.folds += item["sequence"]
            elif item['action'] == "unfold":
                self.unfolds += item["sequence"]
            elif item['action'] == "mark":
                self.highlights += item['sequence']
            else:
                error("action %s is not a valid action" % item["action"])
        elif "highlight" in item and bool(item['highlight']):
            sublime.message_dialog(
                "RegReplace:\n\"on_save_sequence\" setting option '\"highlight\": true' is deprecated!"
                "\nPlease use '\"action\": \"mark\"'."
            )
            self.highlights += item['sequence']
        else:
            self.replacements.append(
                {
                    "sequence": item['sequence'],
                    "multi_pass": True if "multi_pass" in item and bool(item['multi_pass']) else False
                }
            )
开发者ID:dlwilson88,项目名称:RegReplace,代码行数:25,代码来源:rr_sequencer.py


示例20: get_target_ros_path

def get_target_ros_path(user_query=True):
    ros_path_settings = sublime.load_settings(ROS_PATH_KEY)
    path = ros_path_settings.get("path", "")
    if path == "" and user_query:
        sublime.message_dialog(MESSAGE_NO_KEY)
        sublime.active_window().show_input_panel("Target ROS path:", "", save_ros_target_path, None, None)
    return path
开发者ID:mstaflex,项目名称:sublime_tweaks,代码行数:7,代码来源:ros_distribute.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python sublime.ok_cancel_dialog函数代码示例发布时间:2022-05-27
下一篇:
Python sublime.load_settings函数代码示例发布时间: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