コード例 #1
0
ファイル: skypedbus.py プロジェクト: six519/PYTHON-SKYPE-DBUS
	def is_service_running(self):

		try:

			services_list = self.dbus_session.get_object(DBUS, DBUS_PATH).ListNames()
			self.checkIfConnectedCtr += 1

			for service in services_list:
				if service == SKYPE_API:

					if self.checkIfConnectedCtr == 5:
						self.checkIfConnectedCtr = 0
						get_connection_status = DBusConnectionStatMsg()
						response = self.send_message(get_connection_status.get().connection_status().toStr())
						msg_processor = DBusMsgProcessor(self)
						msg_processor.process_message(response, True)

						if self.quit_now:
							return False
					return True
					break
		except DBusException:
			pass

		return False
コード例 #2
0
ファイル: skypedbus.py プロジェクト: six519/PYTHON-SKYPE-DBUS
	def Notify(self, skype_cmd):
		firedEvent = ""
		#recent_message is used to ignore duplicate message
		if self.recent_message != skype_cmd:
			#print "Skype returns: %s" % skype_cmd
			msg_processor = DBusMsgProcessor(self.skype_dbus)
			firedEvent = msg_processor.process_message(skype_cmd)

			if firedEvent:
				print "Event fired: %s" % firedEvent
			else:
				print "Skype command: %s" % skype_cmd
		
		self.recent_message = skype_cmd