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


Python signals.emit函数代码示例

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


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

示例1: on_xmms_playlist_changed

 def on_xmms_playlist_changed(self, pls, type, id, pos, newpos):
   if pos is None and \
      type in (xmmsclient.PLAYLIST_CHANGED_ADD,
               xmmsclient.PLAYLIST_CHANGED_MOVE,
               xmmsclient.PLAYLIST_CHANGED_REMOVE):
     self._reload()
     signals.emit('need-redraw')
开发者ID:GunioRobot,项目名称:ccx2,代码行数:7,代码来源:playlist.py

示例2: _loop

    def _loop(self):
        previous_buffer = ''
        while self.connected:
            try:
                gevent.sleep() # Force a yield. We want to be fair to other connections
                newdata = self.socket.recv(512)
                lines = (previous_buffer + newdata).split('\r\n')

                if not newdata:
                    # No data returned from recv - assume connection is broken
                    self.disconnect('Connection reset by peer')
                    continue
                # If newdata cuts off the end of a command, store it and we'll get the rest next time through
                if not newdata.endswith('\r\n'):
                    previous_buffer = lines.pop()
                else:
                    previous_buffer = '' # Clear it out for the next time round

                for line in lines:
                    message = line.strip()
                    if message == '':
                        continue # Ignore empty messages
                    self.raw_logger.debug('<' + message)
                    signals.emit('server incoming', (self, line))
            except socket.error, e:
                self.disconnect(e[1]) # Element 1 is the error message
                continue
开发者ID:niax,项目名称:NiaxBot,代码行数:27,代码来源:server.py

示例3: pushCommand

	def pushCommand( self, cmd, redo = False ):
		if not cmd.hasHistory():
			return cmd.redo()

		if not self.canUndo():
			#TODO: Warning about non-undoable action
			pass

		assert not hasattr( cmd, 'inStack' )
		count = len( self.undoStack )
		cmd.inStack = True
		cmd.merged = False
		if count>0:
			lastCommand = self.undoStack[ count - 1 ]
			if cmd.canMerge( lastCommand ):
				cmd.merged = True
			if count >= self.stackLimit:
				self.undoStack.pop( 0 )
		self.undoStack.append( cmd )

		if cmd.redo() == False: #failed
			self.undoStack.pop()
			return False
		if not redo:
			signals.emit( 'command.new', cmd, self )
			self.redoStack = []
		else:
			signals.emit( 'command.redo', cmd, self )


		return True
开发者ID:cloudteampro,项目名称:juma-editor,代码行数:31,代码来源:Command.py

示例4: run

	def run( self, **kwargs ):
		if not self.initialized: 
			if not self.init( **kwargs ):
				return False
		hasError = False
		self.resetMainLoopBudget()
		
		try:
			signals.emitNow('app.pre_start')

			EditorModuleManager.get().startAllModules()
			self.getProject().getAssetLibrary().scanProject()

			signals.emitNow('app.start')
			signals.dispatchAll()

			self.saveConfig()

			EditorModuleManager.get().tellAllModulesAppReady()
			signals.emit('app.ready')

			#main loop
			while self.running:
				self.doMainLoop()

		except Exception, e:
			#TODO: popup a alert window?
			logging.exception( e )
			hasError = True
开发者ID:pixpil,项目名称:gii,代码行数:29,代码来源:EditorApp.py

示例5: server_event

def server_event(server, data, prefix):
    data = data.strip()
    cmd_match = re.match("(?P<command>[^ ]+) (?P<params>.*)", data)
    command, params = cmd_match.group('command'), cmd_match.group('params')

    params = _process_params(params)
    signals.emit('event %s' % command.lower(), (server, params, prefix))
开发者ID:niax,项目名称:NiaxBot,代码行数:7,代码来源:server.py

示例6: _on_collection_changed

 def _on_collection_changed(self, r):
   if not r.iserror():
     v = r.value()
     signals.emit('xmms-collection-changed',
                  v['name'],
                  v['type'],
                  v.get('namespace'),
                  v.get('newname'))
开发者ID:GunioRobot,项目名称:ccx2,代码行数:8,代码来源:xmms.py

示例7: unloadModule

	def unloadModule( self, m ):
		self.moduleChanged = True
		if m.isDependentUnloaded():
			signals.emit('module.unload',m)
			m.unload()
			return True
		else:
			return False
开发者ID:cloudteampro,项目名称:juma-editor,代码行数:8,代码来源:EditorModule.py

示例8: _on_playlist_changed

 def _on_playlist_changed(self, r):
   if not r.iserror():
     v = r.value()
     signals.emit('xmms-playlist-changed',
                  v['name'],
                  v['type'],
                  v.get('id'),
                  v.get('position'),
                  v.get('newposition'))
开发者ID:GunioRobot,项目名称:ccx2,代码行数:9,代码来源:xmms.py

示例9: _update

  def _update(self):
    self.ctx['status'] = HeaderBar.status_desc[self.status]
    self.ctx['elapsed'] = util.humanize_time(self.time)
    if 'duration' in self.info:
      self.ctx['total'] = util.humanize_time(self.info['duration'])

    self.text.set_text(self.parser.eval(self.ctx))
    self._invalidate()
    signals.emit('need-redraw')
开发者ID:GunioRobot,项目名称:ccx2,代码行数:9,代码来源:main.py

示例10: _namelist

 def _namelist(self, server, params, prefix):
     if server == self.server and params[-2] == self.name: # params[0] is the channel
         nicks = [] #TODO: Make this do things
         for user in self.namelist_split.finditer(params[-1]):
             nick = user.group('nick')
             if nick in self.nicks:
                 continue # Ignore this nick
             self.nicks[nick] = Nick(server, nick, mode=user.group('mode'))
         signals.emit('channel name reply', (server, self, nicks))
开发者ID:niax,项目名称:NiaxBot,代码行数:9,代码来源:messaging.py

示例11: on_xmms_collection_changed

  def on_xmms_collection_changed(self, pls, type, namespace, newname):
    if namespace == 'Playlists' and type != xmmsclient.COLLECTION_CHANGED_UPDATE:
      if pls == self.cur_active:
        self.cur_active = newname

      self.clear_attrs()
      self._set_active_attr(None, self.cur_active)

      signals.emit('need-redraw')
开发者ID:GunioRobot,项目名称:ccx2,代码行数:9,代码来源:playlist.py

示例12: on_medialib_entry_changed

 def on_medialib_entry_changed(self, mid):
   if mid in self.song_widgets:
     del self.song_widgets[mid]
     for pos in self.feeder.id_positions(mid):
       try:
         del self.row_widgets[pos]
       except KeyError:
         pass
     signals.emit('need-redraw')
开发者ID:GunioRobot,项目名称:ccx2,代码行数:9,代码来源:playlist.py

示例13: unregisterModule

	def unregisterModule(self, m):
		if m.alive:
			if m.isDependentUnloaded():
				self.moduleChanged = True
				m.unload()
				del self.modules[m.getName()]
				self.moduleQueue.remove(m)
				signals.emit( 'module.unregister', m )
			else:
				return False
开发者ID:cloudteampro,项目名称:juma-editor,代码行数:10,代码来源:EditorModule.py

示例14: run

  def run(self):
    self.lyrics.set_info("searching...")
    signals.emit('need-redraw')

    results = lyricwiki.get_google_results(self.query)

    if self.abort:
      return
    
    self.lyrics.show_results(results)
开发者ID:GunioRobot,项目名称:ccx2,代码行数:10,代码来源:lyrics.py

示例15: queue_current

	def queue_current(self):
		item = super(AlbumWalker, self)._get_raw(self.focus)
		if item is None:
			return None
		song_id = None
		for song in self.mpc.find('artist', self.artist, 'album', item['album']):
			sid = self.mpc.addid(song['file'])
			if song_id is None:
				song_id = sid
		signals.emit('user_notification', 'Adding album "%s" - %s' % (item['album'], self.artist))
		return song_id
开发者ID:sporkexec,项目名称:urmpc,代码行数:11,代码来源:ui_lists.py


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