Пример #1
0
	def pruneMessages(self):
		try:
			now = time.mktime(evegate.currentEveTime().timetuple())
			for row in range(self.chatListWidget.count()):
				chatListWidgetItem = self.chatListWidget.item(0)
				chatEntryWidget = self.chatListWidget.itemWidget(chatListWidgetItem)
				message = chatEntryWidget.message
				if now - time.mktime(message.timestamp.timetuple()) > MESSAGE_EXPIRY_IN_SECONDS:
					self.chatEntries.remove(chatEntryWidget)
					self.chatListWidget.takeItem(0)

					for widgetInMessage in message.widgets:
						widgetInMessage.removeItemWidget(chatListWidgetItem)
				else:
					break
		except Exception as e:
			print e
Пример #2
0
    def pruneMessages(self):
        try:
            now = time.mktime(evegate.currentEveTime().timetuple())
            for row in range(self.chatListWidget.count()):
                chatListWidgetItem = self.chatListWidget.item(0)
                chatEntryWidget = self.chatListWidget.itemWidget(chatListWidgetItem)
                message = chatEntryWidget.message
                if now - time.mktime(message.timestamp.timetuple()) > MESSAGE_EXPIRY_SECS:
                    self.chatEntries.remove(chatEntryWidget)
                    self.chatListWidget.takeItem(0)

                    for widgetInMessage in message.widgets:
                        widgetInMessage.removeItemWidget(chatListWidgetItem)
                else:
                    break
        except Exception as e:
            logging.error(e)
Пример #3
0
	def showKosResult(self, state, text, requestType, hasKos):
		try:
			if hasKos:
				SoundManager().playSound("kos", text)
			if state == "ok":
				if requestType == "xxx":  # a xxx request out of the chat
					self.trayIcon.showMessage("Player KOS-Check", text, 1)
				elif requestType == "clipboard":  # request from clipboard-change
					if len(text) <= 0:
						text = "None KOS"
					self.trayIcon.showMessage("Your KOS-Check", text, 1)
				text = text.replace("\n\n", "<br>")
				message = chatparser.chatparser.Message("Vintel KOS-Check", text, evegate.currentEveTime(), "VINTEL", [],
														states.NOT_CHANGE, text.upper(), text)
				self.addMessageToIntelChat(message)
			elif state == "error":
				self.trayIcon.showMessage("KOS Failure", text, 3)
		except Exception:
			pass
		self.trayIcon.setIcon(self.taskbarIconQuiescent)
Пример #4
0
 def showKosResult(self, state, text, requestType, hasKos):
     if not self.scanIntelForKosRequestsEnabled:
         return
     try:
         if hasKos:
             SoundManager().playSound("kos", text)
         if state == "ok":
             if requestType == "xxx":  # An xxx request out of the chat
                 self.trayIcon.showMessage("Player KOS-Check", text, 1)
             elif requestType == "clipboard":  # request from clipboard-change
                 if len(text) <= 0:
                     text = "None KOS"
                 self.trayIcon.showMessage("Your KOS-Check", text, 1)
             text = text.replace("\n\n", "<br>")
             message = chatparser.chatparser.Message("Spyglass KOS-Check", text, evegate.currentEveTime(), "Spyglass",
                                                     [], states.NOT_CHANGE, text.upper(), text)
             self.addMessageToIntelChat(message)
         elif state == "error":
             self.trayIcon.showMessage("KOS Failure", text, 3)
     except Exception:
         pass
     self.trayIcon.setIcon(self.taskbarIconQuiescent)