Esempio n. 1
0
	def P_message(self, request):
		res = self.testMandatoryArguments(request, ["text", "type"])
		if res:
			return res

		try:
			ttype = int(request.args["type"][0])
		except ValueError:
			return {
				"result": False,
				"message": _("type %s is not a number") % request.args["type"][0]
			}

		timeout = -1
		if "timeout" in request.args.keys():
			try:
				timeout = int(request.args["timeout"][0])
			except ValueError:
				pass

		return sendMessage(self.session, request.args["text"][0], ttype, timeout)
Esempio n. 2
0
	def P_message(self, request):
		res = self.testMandatoryArguments(request, ["text", "type"])
		if res:
			return res

		try:
			ttype = int(request.args["type"][0])
		except ValueError:
			return {
				"result": False,
				"message": _("type %s is not a number") % request.args["type"][0]
			}

		timeout = -1
		if "timeout" in request.args.keys():
			try:
				timeout = int(request.args["timeout"][0])
			except ValueError:
				pass

		return sendMessage(self.session, request.args["text"][0], ttype, timeout)
Esempio n. 3
0
		try:
			ttype = int(request.args["type"][0])
		except Exception, e:
			return {
				"result": False,
				"message": "type %s is not a number" % request.args["type"][0]
			}
			
		timeout = -1
		if "timeout" in request.args.keys():
			try:
				timeout = int(request.args["timeout"][0])
			except Exception, e:
				pass
				
		return sendMessage(self.session, request.args["text"][0], ttype, timeout)
		
	def P_messageanswer(self, request):
		return getMessageAnswer()

	def P_movielist(self, request):
		tag = None
		if "tag" in request.args.keys():
			tag = request.args["tag"][0]
			
		dirname = None
		if "dirname" in request.args.keys():
			dirname = request.args["dirname"][0]
			
		return getMovieList(dirname, tag, request.args)
Esempio n. 4
0
	def P_message(self, request):
		return sendMessage(self, request)
Esempio n. 5
0
            ttype = int(request.args["type"][0])
        except Exception, e:
            return {
                "result": False,
                "message":
                _("type %s is not a number") % request.args["type"][0]
            }

        timeout = -1
        if "timeout" in request.args.keys():
            try:
                timeout = int(request.args["timeout"][0])
            except Exception, e:
                pass

        return sendMessage(self.session, request.args["text"][0], ttype,
                           timeout)

    def P_messageanswer(self, request):
        return getMessageAnswer()

    def P_movielist(self, request):
        self.isGZ = True
        return getMovieList(request.args)

    def P_fullmovielist(self, request):
        self.isGZ = True
        return getAllMovies()

    def P_movielisthtml(self, request):
        request.setHeader("content-type", "text/html")
        return getMovieList(request.args)
Esempio n. 6
0
 def P_message(self, request):
     return sendMessage(self, request)