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

Python sublime.set_timeout_async函数代码示例

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

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



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

示例1: on_load_async

	def on_load_async( self, view ):

		self.new_ColorScheme = None

		window = view.window()

		try:
			windowVariables = window.extract_variables()
			file     = windowVariables[ "file"      ]
			filePath = windowVariables[ "file_path" ]
			fileName = windowVariables[ "file_name" ]
		except( AttributeError, KeyError ) as e :
			return

		settings = sublime.load_settings( "ConditionalColorSchemes.sublime-settings" )
		preferred_ColorScheme_Set    = settings.get( "preferred_ColorScheme_Set", "" )
		include_FileName_In_FilePath = settings.get( "include_FileName_In_FilePath", "" )
		fileName_ColorSchemes        = settings.get( "fileName_ColorSchemes", [] )
		filePath_ColorSchemes        = settings.get( "filePath_ColorSchemes", [] )

		if include_FileName_In_FilePath == True:
			filePath = file

		if preferred_ColorScheme_Set == "filePath_ColorSchemes":
			self.get_Conditional_ColorScheme( fileName, fileName_ColorSchemes )
			self.get_Conditional_ColorScheme( filePath, filePath_ColorSchemes )
		elif preferred_ColorScheme_Set == "fileName_ColorSchemes":
			self.get_Conditional_ColorScheme( filePath, filePath_ColorSchemes )
			self.get_Conditional_ColorScheme( fileName, fileName_ColorSchemes )

		if self.new_ColorScheme != None:
			set_ColorScheme = lambda: view.settings().set( "color_scheme", self.new_ColorScheme )
			sublime.set_timeout_async( set_ColorScheme )
开发者ID:Enteleform,项目名称:ST_ConditionalColorSchemes,代码行数:33,代码来源:ConditionalColorSchemes.py


示例2: on_selection

        def on_selection(id):
            if id == -1:
                return

            selection = menu_options[id]

            if not selection.requires_action:
                return

            elif selection.menu_text == ADD_ALL_UNSTAGED_FILES:
                self.git("add", "--update", ".")
                scope_of_action = "all unstaged files"

            elif selection.menu_text == ADD_ALL_FILES:
                self.git("add", "--all")
                scope_of_action = "all files"

            elif selection.is_untracked:
                self.git("add", "--", selection.filename)
                scope_of_action = "`{}`".format(selection.filename)

            else:
                self.git("add", "--update", "--", selection.filename)
                scope_of_action = "`{}`".format(selection.filename)

            sublime.status_message("Successfully added `{}`.".format(
                scope_of_action))

            sublime.set_timeout_async(self.run_async, 0)
开发者ID:kostyll,项目名称:GitSavvy,代码行数:29,代码来源:quick_stage.py


示例3: run

    def run(self, edit):
        interface = ui.get_interface(self.view.id())

        non_cached_sections = (interface.get_view_regions("unstaged_files") +
                               interface.get_view_regions("untracked_files") +
                               interface.get_view_regions("merge_conflicts"))
        non_cached_lines = util.view.get_lines_from_regions(
            self.view,
            self.view.sel(),
            valid_ranges=non_cached_sections
        )
        non_cached_files = (
            os.path.join(self.repo_path, line.strip())
            for line in non_cached_lines
            if line[:4] == "    "
        )

        cached_sections = interface.get_view_regions("staged_files")
        cached_lines = util.view.get_lines_from_regions(
            self.view,
            self.view.sel(),
            valid_ranges=cached_sections
        )
        cached_files = (
            os.path.join(self.repo_path, line.strip())
            for line in cached_lines
            if line[:4] == "    "
        )

        sublime.set_timeout_async(
            lambda: self.load_diff_windows(non_cached_files, cached_files), 0)
开发者ID:gwenzek,项目名称:GitSavvy,代码行数:31,代码来源:status.py


示例4: _with_open_file

    def _with_open_file(self, filename, f):
        """Opens filename (relative to the plugin) in a new view, calls
        f(view) to perform the tests.
        """
        window = sublime.active_window()
        path = os.path.join(plugin_path, filename)
        view = window.open_file(path)
        q = queue.Queue()

        def async_test_view():
            try:
                # Wait for view to finish loading.
                for n in range(500):
                    if view.is_loading():
                        time.sleep(0.01)
                    else:
                        break
                else:
                    raise AssertionError('View never loaded.')
                # Run the tests on this view.
                f(view)
            except Exception as e:
                q.put(e)
            else:
                q.put(None)

        try:
            sublime.set_timeout_async(async_test_view, 0)
            msg = q.get()
            if msg:
                raise msg
        finally:
            window.focus_view(view)
            window.run_command('close_file')
开发者ID:Jayflux,项目名称:sublime-rust,代码行数:34,代码来源:test_syntax_check.py


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


示例6: run

 def run(self, filename=None, limit=6000, author=None, log_current_file=False):
     self._pagination = 0
     self._filename = filename
     self._limit = limit
     self._author = author
     self._log_current_file = log_current_file
     sublime.set_timeout_async(self.run_async)
开发者ID:harshanarayana,项目名称:GitSavvy,代码行数:7,代码来源:log.py


示例7: start_stdout_watcher

 def start_stdout_watcher(self):
     sdk = SDK()
     t = StdoutWatcher(self, sdk.path)
     # Thread dies with the main thread.
     t.daemon = True
     # XXX: This is necessary. If we call t.start() directly, ST hangs.
     sublime.set_timeout_async(t.start, 0)
开发者ID:jerrywell,项目名称:dart-sublime-bundle,代码行数:7,代码来源:analyzer.py


示例8: start_command

	def start_command(self, file_name, use_bundler=False):
		is_legal, file_path, arguments = PathHelper.get_file(file_name, self.window)

		if is_legal:
			sublime.set_timeout_async(lambda file_path=file_path,bundle=use_bundler, args=arguments: self.start_command_async(file_path, bundle, *args), 0)
		else:
			sublime.message_dialog("File: " + file_path+" does not exists")
开发者ID:lepht,项目名称:sublime_debugger,代码行数:7,代码来源:debug_command.py


示例9: run

	def run(self, edit, action=None, clr_tests=False, text=None, sync_out=True, crash_line=None, value=None):
		v = self.view
		scope_name = v.scope_name(v.sel()[0].begin()).rstrip()
		file_syntax = scope_name.split()[0]
		if action == 'insert':
			v.insert(edit, v.sel()[0].begin(), text)
		elif action == 'make_opd':
			self.close_opds()
			self.create_opd(clr_tests=clr_tests, sync_out=sync_out)
		elif action == 'show_crash_line':
			pt = v.text_point(crash_line - 1, 0)
			v.erase_regions('crash_line')
			v.add_regions('crash_line', [sublime.Region(pt + 0, pt + 0)], \
				'variable.language.python', 'bookmark', \
				sublime.DRAW_SOLID_UNDERLINE)
			sublime.set_timeout_async(lambda pt=pt: v.show_at_center(pt), 39)
			# print(pt)
		elif action == 'get_var_value':
			self.get_var_value()

		elif action == 'show_var_value':
			self.show_var_value(value)

		elif action == 'toggle_using_debugger':
			self.toggle_using_debugger()

		elif action == 'sync_opdebugs':
			w = v.window()
			layout = w.get_layout()

			def slow_hide(w=w, layout=layout):
				if layout['cols'][1] < 1:
					layout['cols'][1] += 0.001
					w.set_layout(layout)
					sublime.set_timeout(slow_hide, 1)
				else:
					layout['cols'][1] = 1
					w.set_layout(layout)
					print('stopped')

			if len(layout['cols']) == 3:
				if layout['cols'][1] != 1:
					# hide opd panel
					self.ruler_opd_panel = min(layout['cols'][1], 0.93)
					layout['cols'][1] = 1
					# <This Region May be uncomment>
					#for x in w.views_in_group(1):
					#	x.run_command('test_manager', {'action': 'hide_text'})
					# < / >
					# slow_hide()
					w.set_layout(layout)
				else:
					# show opd panel
					layout['cols'][1] = self.ruler_opd_panel
					need_x = self.ruler_opd_panel
					# < This Region May be uncomment >
					#for x in w.views_in_group(1):
					#	x.run_command('test_manager', {'action': 'show_text'})
					# < / >
					w.set_layout(layout)
开发者ID:Jatana,项目名称:FastOlympicCoding,代码行数:60,代码来源:test_manager.py


示例10: init

    def init(self) -> None:
        """Initialize this project anagonda
        """

        if self.AVAILABLE is True:
            self.install_tools()

            def monitor():
                start = time.time()
                while not self.__tools_instaled() and time.time() - start <= 300:  # noqa
                    time.sleep(0.5)

                if time.time() - start >= 300:
                    sublime.message_dialog(
                        'Go utils not available for this project, look at the '
                        'log panel to fix any issue with your system, then '
                        'restart Sublime Text 3'
                    )
                else:
                    self._projects[self._project_name]['anagonda'] = True
                if os.name != 'nt':
                    sublime.set_timeout_async(
                        lambda: sublime.active_window().run_command(
                            'anaconda_go_fill_browse'), 0
                    )

            sublime.set_timeout_async(lambda: monitor(), 0)
开发者ID:DamnWidget,项目名称:anaconda_go,代码行数:27,代码来源:__init__.py


示例11: run

	def run(self):

		scriptPath = inspect.getframeinfo(inspect.currentframe()).filename
		scriptDir = os.path.dirname(scriptPath)

		os.chdir(scriptDir)

		files = ",".join(sorted(BrowsersyncState.watchPaths))
		index = sorted(BrowsersyncState.startFiles)[BrowsersyncState.startFileIndex]
		server = os.path.dirname(index)

		index = index.replace(server + "\\", "")

		plat = sublime.platform()

		killMethod = {
			'osx': 'killall -KILL node-osx',
			'linux': 'pkill -x node-linux',
			'windows': 'taskkill /im node-windows.exe /f /t'
		}.get(plat)

		os.system(killMethod)

		cmd = 'node-{0} browser_sync_launch.js "{1}" "{2}" "{3}"'
		cmd = cmd.format(plat, server,files, index)

		sublime.set_timeout_async(self.make_callback(cmd), 0)
开发者ID:iamdjones,项目名称:sublime-text-browser-sync,代码行数:27,代码来源:browser_sync.py


示例12: run

    def run(self, edit):
        """Command to index open tab RF file and create db index table.

        Purpose of the command is create index, from the open tab.
        Index should contain all the resource and library imports and
        all global variables from variable tables and imported variable
        files.
        """
        log_file = get_setting(SettingObject.log_file)
        python_binary = get_setting(SettingObject.python_binary)
        table_dir = get_setting(SettingObject.table_dir)
        makedirs(path.dirname(log_file), exist_ok=True)
        open_tab = self.view.file_name()
        if not open_tab:
            message = 'Not able to index because no tabs are active'
            sublime.status_message(message)
            return
        db_table_name = self.get_table_name(open_tab)
        if db_table_name:
            file_ = open(log_file, 'a')
            sublime.set_timeout_async(self.run_single_index(
                    python_binary,
                    table_dir,
                    db_table_name,
                    file_
                ), 0)
            file_.close()
            message = update_current_view_index(self.view)
            sublime.status_message(message)
        else:
            message = 'Not able to index file: {0}'.format(open_tab)
            sublime.status_message(message)
开发者ID:GLMeece,项目名称:sublime-robot-framework-assistant,代码行数:32,代码来源:index_open_tab.py


示例13: oracle

    def oracle(self, end_offset, begin_offset=None, mode="describe", callback=None):
        """ Builds the oracle shell command and calls it, returning it's output as a string.
        """

        pos = "#" + str(end_offset)
        if begin_offset is not None:
            pos = "#%i,#%i" %(begin_offset, end_offset)
        env = get_setting("env")

        # Build oracle cmd.
        cmd = "export GOPATH=\"%(go_path)s\"; export PATH=%(path)s; oracle -pos=%(file_path)s:%(pos)s -format=%(output_format)s %(mode)s %(scope)s"  % {
        "go_path": env["GOPATH"],
        "path": env["PATH"],
        "file_path": self.view.file_name(),
        "pos": pos,
        "output_format": get_setting("oracle_format"),
        "mode": mode,
        # TODO if scpoe is not set, use main.go under pwd or sublime project path.
        "scope": ' '.join(get_setting("oracle_scope"))} 

        if "GOROOT" in env:
            gRoot = "export GOROOT=\"%s\"; " % env["GOROOT"] 
            cmd = gRoot + cmd

        sublime.set_timeout_async(lambda: self.runInThread(cmd, callback), 0)
开发者ID:kdar,项目名称:GoOracle,代码行数:25,代码来源:goOracle.py


示例14: async_do

def async_do(f, progress_msg="Evernote operation", done_msg=None):
    if not done_msg:
        done_msg = progress_msg + ': ' + "done!"
    status = {'done': False, 'i': 0}

    def do_stuff(s):
        try:
            f()
        except:
            pass
        finally:
            s['done'] = True

    def progress(s):
        if s['done']:
            sublime.status_message(done_msg)
        else:
            i = s['i']
            bar = "... [%s=%s]" % (' '*i, ' '*(7-i))
            sublime.status_message(progress_msg + bar)
            s['i'] = (i + 1) % 8
            sublime.set_timeout(lambda: progress(s), 100)

    sublime.set_timeout(lambda: progress(status), 0)
    sublime.set_timeout_async(lambda: do_stuff(status), 0)
开发者ID:everyevery,项目名称:sublime-evernote,代码行数:25,代码来源:sublime_evernote.py


示例15: apply_diffs_for_pts

    def apply_diffs_for_pts(self, cursor_pts, reset):
        in_cached_mode = self.view.settings().get("git_savvy.diff_view.in_cached_mode")

        # Apply the diffs in reverse order - otherwise, line number will be off.
        for pt in reversed(cursor_pts):
            hunk_diff = self.get_hunk_diff(pt)

            # The three argument combinations below result from the following
            # three scenarios:
            #
            # 1) The user is in non-cached mode and wants to stage a hunk, so
            #    do NOT apply the patch in reverse, but do apply it only against
            #    the cached/indexed file (not the working tree).
            # 2) The user is in non-cached mode and wants to undo a line/hunk, so
            #    DO apply the patch in reverse, and do apply it both against the
            #    index and the working tree.
            # 3) The user is in cached mode and wants to undo a line hunk, so DO
            #    apply the patch in reverse, but only apply it against the cached/
            #    indexed file.
            #
            # NOTE: When in cached mode, no action will be taken when the user
            #       presses SUPER-BACKSPACE.

            self.git(
                "apply",
                "-R" if (reset or in_cached_mode) else None,
                "--cached" if (in_cached_mode or not reset) else None,
                "-",
                stdin=hunk_diff
            )

        sublime.set_timeout_async(lambda: self.view.run_command("gs_diff_refresh"))
开发者ID:abusalimov,项目名称:GitSavvy,代码行数:32,代码来源:diff.py


示例16: run

    def run(self, i):
        if not self.thread.is_alive():
            if hasattr(self.thread, 'result') and not self.thread.result:
                sublime.status_message('')
                return

            # After thread is end, display feedback to end user
            # according to response
            result = self.api.result
            if isinstance(result, dict) and "success" in result and not result["success"]:
                if self.open_console: 
                    util.show_output_panel(message.SEPRATE.format(util.format_error_message(result)))

                settings = context.get_settings()
                delay_seconds = settings["delay_seconds_for_hidden_output_panel_when_failed"]
                sublime.set_timeout_async(util.hide_output_panel, delay_seconds * 1000)
            else:
                sublime.status_message(self.success_message)
            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:tedcheng,项目名称:SublimeApex,代码行数:33,代码来源:progress.py


示例17: on_enter_directory

    def on_enter_directory(self, path):
        self.suggested_git_root = path
        if self.suggested_git_root and os.path.exists(os.path.join(self.suggested_git_root, ".git")):
            sublime.ok_cancel_dialog(RECLONE_CANT_BE_DONE)
            return

        sublime.set_timeout_async(self.do_clone, 0)
开发者ID:stoivo,项目名称:GitSavvy,代码行数:7,代码来源:init.py


示例18: scroll_to

    def scroll_to(self, coords):
        pattern = r".{{40}} \| {lineno: >4} ".format(lineno=coords[0] + 1)
        corresponding_region = self.view.find(pattern, 0)
        blame_view_pt = corresponding_region.b

        self.view.sel().add(sublime.Region(blame_view_pt, blame_view_pt))
        sublime.set_timeout_async(lambda: self.view.show_at_center(blame_view_pt), 0)
开发者ID:dufferzafar,项目名称:GitSavvy,代码行数:7,代码来源:blame.py


示例19: run

    def run(self, edit):
        self.output = ''

        # async run the build so sublime doesn't hang

        sublime.set_timeout_async(self.buildruncheck)
        sublime.set_timeout_async(self.printoutput)
开发者ID:AramRafeq,项目名称:CppBuilder,代码行数:7,代码来源:Builder.py


示例20: on_selection

        def on_selection(id):
            if id == -1:
                return

            selection = menu_options[id]

            if not selection.requires_action:
                return

            elif selection.menu_text == COMMIT:
                self.window.run_command("gs_quick_commit")
                return

            elif selection.menu_text == ADD_ALL_UNSTAGED_FILES:
                self.git("add", "--update", ".")
                scope_of_action = "all unstaged files"

            elif selection.menu_text == ADD_ALL_FILES:
                self.git("add", "--all")
                scope_of_action = "all files"

            elif selection.is_untracked:
                self.git("add", "--", selection.filename)
                scope_of_action = "`{}`".format(selection.filename)

            else:
                self.git("add", "--update", "--", selection.filename)
                scope_of_action = "`{}`".format(selection.filename)

            sublime.status_message("Successfully added `{}`.".format(
                scope_of_action))
            util.view.refresh_gitsavvy(self.window.active_view())

            sublime.set_timeout_async(self.run_async, 0)
开发者ID:asfaltboy,项目名称:GitSavvy,代码行数:34,代码来源:quick_stage.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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