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

Python urwid.disconnect_signal函数代码示例

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

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



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

示例1: clear

 def clear(self):
     urwid.disconnect_signal(self.walker, 'modified', self.interface.lazzy_load)
     while len(self.walker) > 1:
         pop = self.walker.pop()
         self.cleared = pop.id
     if self.cleared == None:
         self.cleared = True
开发者ID:kezabelle,项目名称:tyrs,代码行数:7,代码来源:timeline.py


示例2: complete_move

    def complete_move(self, value, current_position):
        urwid.disconnect_signal(
            self,
            self.move_prompt,
            signals.PROMPT_DONE,
            self.complete_move)
        urwid.disconnect_signal(
            self,
            self.move_prompt,
            signals.UPDATE_INDEX,
            self.view.move_update_index)

        self.update_focus('body')

        try:
            new_index = int(value)
            logger.debug('Moving playlist track from {} to {}'.format(
                current_position, new_index))

            mpd = mstat.initialize_mpd(self.conf)
            mpd.move(current_position, new_index)
            self.view.focus_position = new_index
        except (TypeError, ValueError):
            logger.error('Invalid move index: {}'.format(value))

        self.view.update()
        self.update()
开发者ID:thesquelched,项目名称:suggestive,代码行数:27,代码来源:playlist.py


示例3: search_entered

 def search_entered(self, content):
     self.view.set_focus('body')
     urwid.disconnect_signal(
         self, self.foot, 'search_entered', self.anime_entered)
     urwid.disconnect_signal(
         self, self.foot, 'query_escaped', self.query_escaped)
     self.view.set_footer(urwid.AttrWrap(self.default_footer, 'foot'))
     
     items = []
     # categories
     if self.current_view == 1 and self.list_sort_type in (0, 1):
         lst = malconstrict.helpers.search_substring(self.cached_sections[self.cats[self.catfocus]], content)
         i = 1
         items.append(CategoryItemWidget(self.cats[self.catfocus]))
         for anime in lst:
             items.append(ListItemWidget(i, anime.title + ' [' + str(anime.score) + ']', anime.id))
             i = i + 1
     # full
     elif (self.current_view == 1 and self.list_sort_type in (2, 3)) or self.current_view == 2:
         items = []
         lst = malconstrict.helpers.search_substring(self.cached_list, content)
         i = 1
         for anime in lst:
             if self.current_view == 1:
                 items.append(ListItemWidget(i, anime.title + ' [' + str(anime.score) + ']', anime.id))
             elif self.current_view == 2:
                 items.append(
                     ListItemWidget(i, anime.title + ' [' + str(anime.members_score) + ']', anime.id))
             i = i + 1
     
     walker = urwid.SimpleListWalker(items)
     self.listbox = urwid.ListBox(walker)
     self.view.set_body(urwid.Frame(urwid.AttrWrap(self.listbox, 'body')))
     self.view.set_footer(urwid.AttrWrap(self.default_footer, 'foot'))
     self.view.set_focus('body')
开发者ID:eartsar,项目名称:malsnakes,代码行数:35,代码来源:malsnakes.py


示例4: query_escaped

 def query_escaped(self, content):
     self.view.set_focus('body')
     urwid.disconnect_signal(
         self, self.foot, 'username_entered', self.username_entered)
     urwid.disconnect_signal(
         self, self.foot, 'anime_entered', self.anime_entered)
     self.view.set_footer(urwid.AttrWrap(self.default_footer, 'foot'))
开发者ID:eartsar,项目名称:malsnakes,代码行数:7,代码来源:malsnakes.py


示例5: command_done

    def command_done(self, command):
        self.top.set_focus('body')
        urwid.disconnect_signal(
            self,
            self.edit,
            signals.COMMAND_DONE,
            self.command_done)

        if command:
            try:
                current_buf = self.top.current_buffer()
                success = current_buf.execute_command(command)
                if not success:
                    success = self.execute_command(command)

                if not success:
                    self.update_footer_text(
                        "Unable to execute command '{}'".format(command),
                        error=True)
            except TypeError as err:
                logger.debug('TypeError: {}'.format(err))
                self.update_footer_text(
                    "Invalid arguments for command '{}'".format(command),
                    error=True)
            except CommandError as ex:
                logger.debug(ex)
                self.update_footer_text(ex.message, error=True)
开发者ID:thesquelched,项目名称:suggestive,代码行数:27,代码来源:app.py


示例6: _promptSearch_done

 def _promptSearch_done(self, query):
     self.view.set_focus("body")
     urwid.disconnect_signal(self, self.prompt, "done", self._promptSearch_done)
     if not query:
         self.set_status()
         return
     self.newbuffer(["search", query])
开发者ID:qarth,项目名称:xapers,代码行数:7,代码来源:ui.py


示例7: go_search

    def go_search(self, what_for):
        # Set the focus back to body
        self.view.set_focus('body')

        # Disconnect
        urwid.disconnect_signal(self.foot_new, 'done', self.go_search)

        # Check if we got a query...
        if not what_for: return

        # Construct a regex (yeah...)
        pattern = r'(.*)' + re.escape(what_for) + r'(.*)'

        # Store elements that match the query
        self.matches = []

        # Loop and match
        n = 0
        for i in self.elements:
            m = re.search(pattern, i.content, re.IGNORECASE)
            if m:
                # self.listbox.set_focus(n)
                # break
                self.matches.append(n)
            n = n + 1

        # Now jump to the first match and then later we can use n N to go around
        if self.matches:
            self.listbox.set_focus(self.matches[0])

            # Set the search pointer to point to the first element.
            self.search_ptr = 0
        else:
            self.search_ptr = -1
开发者ID:infyhr,项目名称:qgh,代码行数:34,代码来源:qgh.py


示例8: hide_editor

 def hide_editor(self, done_signal_handler):
     try:
         disconnect_signal(self._editor, 'done', done_signal_handler)
     except Exception, message:
         # `disconnect_signal` raises an exception if no signal was
         # connected from `self._editor`. we can safely ignore it.
         logging.exception(message)
开发者ID:Erik-k,项目名称:turses,代码行数:7,代码来源:ui.py


示例9: _filterSearch_done

 def _filterSearch_done(self, newquery):
     self.ui.view.set_focus('body')
     urwid.disconnect_signal(self.ui, self.ui.prompt, 'done', self._filterSearch_done)
     if not newquery:
         self.ui.set_status()
         return
     self.ui.newbuffer(['search', self.query, newquery])
开发者ID:nicolassmith,项目名称:xapers,代码行数:7,代码来源:search.py


示例10: switch_body

	def switch_body(self, body):
		if self.body:
			urwid.disconnect_signal(body, "modified", self._invalidate)

		self.body = body
		self._invalidate()

		urwid.connect_signal(body, "modified", self._invalidate)
开发者ID:sushi-irc,项目名称:nigiri,代码行数:8,代码来源:ListBox.py


示例11: hide_editor

 def hide_editor(self, done_signal_handler):
     try:
         disconnect_signal(self._editor, 'done', done_signal_handler)
     except:
         # `disconnect_signal` raises an exception if no signal was
         # connected from `self._editor`. We can safely ignore it.
         pass
     self._editor = None
     self.body.hide_top_widget()
开发者ID:tazjel,项目名称:turses,代码行数:9,代码来源:ui.py


示例12: remove_editor

 def remove_editor(self, done_signal_handler):
     try:
         disconnect_signal(self.editor, 'done', done_signal_handler)
     except:
         # `disconnect_signal` raises an exception if no signal was
         # connected from `self.editor`. We can safely ignore it.
         pass
     self.editor = None
     self.clear_status()
开发者ID:gigigi,项目名称:turses,代码行数:9,代码来源:ui.py


示例13: anime_entered

 def anime_entered(self, content):
     self.view.set_focus('body')
     urwid.disconnect_signal(
         self, self.foot, 'anime_entered', self.anime_entered)
     urwid.disconnect_signal(
         self, self.foot, 'query_escaped', self.query_escaped)
     self.view.set_footer(urwid.AttrWrap(self.default_footer, 'foot'))
     self.display_to_top('MALSnakes - showing results for "' + content + '"')
     self.pull_in_anime_query_list(content)
开发者ID:eartsar,项目名称:malsnakes,代码行数:9,代码来源:malsnakes.py


示例14: login_escaped

 def login_escaped(self, content):
     self.view.set_focus('body')
     urwid.disconnect_signal(
         self, self.foot, 'login_authenticate', self.login_authenticate)
     urwid.disconnect_signal(
         self, self.foot, 'login_escaped', self.login_escaped)
     self.username = ''
     self.password = ''
     self.view.set_footer(urwid.AttrWrap(self.default_footer, 'foot'))
开发者ID:eartsar,项目名称:malsnakes,代码行数:9,代码来源:malsnakes.py


示例15: input_done

    def input_done(self, response):
        urwid.disconnect_signal(self, self.container.get_footer(),
                                'done', self.input_done)
        self.container.set_footer(self.footer)
        self.container.set_focus('body')

        if self.input_callback:
            self.input_callback(response)

        self.input_callback = None
开发者ID:brkcmd,项目名称:pennon,代码行数:10,代码来源:views.py


示例16: _runtest

 def _runtest(self, b):
     if not self._tclist:
         self._emit("message", "No tests selected")
         return
     urwid.disconnect_signal(b, "click", self._runtest) # prevent running again until test ends
     environmentname = self._envsel.value
     reportname = self._repsel.value
     options = self._get_options()
     testlist = [tw.base_widget.text for tw in self._tclist]
     self.runtest(testlist, environmentname, reportname, options)
     self._w.set_focus("body")
开发者ID:bharathi26,项目名称:pycopia,代码行数:11,代码来源:runner.py


示例17: login_authenticate

 def login_authenticate(self, content):
     self.view.set_focus('body')
     urwid.disconnect_signal(
         self, self.foot, 'login_authenticate', self.login_authenticate)
     urwid.disconnect_signal(
         self, self.foot, 'login_escaped', self.login_escaped)
     self.username = content[0]
     self.password = content[1]
     self.view.set_footer(urwid.AttrWrap(self.default_footer, 'foot'))
     self.display_to_top('MALSnakes - logged in as ' + self.username)
     self.authenticated = True
开发者ID:eartsar,项目名称:malsnakes,代码行数:11,代码来源:malsnakes.py


示例18: edit_done

 def edit_done(self, content):
   self.box.set_focus('body')
   urwid.disconnect_signal(self, self.foot, 'done', self.edit_done)
   if content:
     if content[0] == "/":
       self.parse_self_command(content[1:])
     else:
       for friend in self.friends:
         self.send_command(friend, content)
     self.txt.set_text(self.txt.get_text()[0] + "\n<" + self.nick + "> " + content)
   self.inputbox.set_text("> ")
   self.loop.draw_screen()
开发者ID:infodox,项目名称:ICMP-Chat,代码行数:12,代码来源:icmp-chat.py


示例19: edit_done

    def edit_done(self, content=None):
        """After footer editing process is pointed here.

        Args:
            content: The content, what user entered, if any.

        """
        self.view.set_focus('body')
        urwid.disconnect_signal(self.foot_new, 'done', self.edit_done)
        if content:
            # Command processor here?
            self.view.set_body(urwid.Filler(urwid.Text(content), 'top'))
        self.view.set_footer(self.foot)
开发者ID:infyhr,项目名称:qgh,代码行数:13,代码来源:qgh.py


示例20: edit_done

	def edit_done(self, content):
		
		try:
			self.view.set_focus('body')
			urwid.disconnect_signal(self, self.foot, 'done', self.edit_done)
			
			if content:
				self.q = '\"'+content+'\"'
				self.num = 50
				self.order = 'relevance'
				self.execute()
			
			self.view.set_footer(None)
		
		except Exception as e:
			logging.exception(e)
开发者ID:0xPr0xy,项目名称:youtube-cli,代码行数:16,代码来源:youtube.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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