1 # -*- coding: utf-8 -*-
3 # ****************************************************************************
4 # Copyright (c) 2008 INdT/Fucapi.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # ============================================================================
19 # Project Name : PC Remote
20 # Author : Nilson Silva, Jonatas Isvi
21 # Email : fergus.mao@gmail.com, jonatas.nona@gmail.com
22 # Reviewer : Jônatas Isvi
25 # Package : Main Application
26 # Description : Service Application
27 # ============================================================================
29 from ObjectServers import *
34 supports all services applications
39 self.keyboard_srv = None
42 #Set the Service requested by the Service Manager
43 def set_service(self, command):
45 self.service = command
47 if self.service == 'Tablet':
48 self.mouse_srv = Mouse_Server()
49 self.keyboard_srv = KeyBoard_Server()
50 elif self.service == 'Slideshow':
51 self.mouse_srv = Mouse_Server()
52 self.keyboard_srv = KeyBoard_Server()
53 elif self.service == 'Player':
54 print "player service."
55 elif self.service == 'Torrent':
56 print "torrent service."
58 #Returns the Service which is being executed
59 def get_service(self):
62 #Executes the action requested by the Service Manager
63 def execute(self, command):
65 cmd = command.split(":")
68 self.mouse_srv.execute(cmd[1])
69 elif cmd[0] == "Keyboard":
70 self.keyboard_srv.execute(cmd[1])
72 # clean all button and keys pressed
74 self.mouse_srv.clean_up_mouse()
75 self.keyboard_srv.clean_up_keyboard()