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
44 #Set the Service requested by the Service Manager
45 def set_service(self, command):
47 self.service = command
49 if self.service == 'Tablet':
50 self.mouse_srv = Mouse_Server(self.service)
51 self.keyboard_srv = KeyBoard_Server(self.service)
52 elif self.service == 'Slideshow':
53 self.mouse_srv = Mouse_Server(self.service)
54 self.keyboard_srv = KeyBoard_Server(self.service)
55 elif self.service == 'Player':
56 self.player_srv = Player_Server()
57 elif self.service == 'Torrent':
58 print "torrent service."
60 #Returns the Service which is being executed
61 def get_service(self):
64 #Executes the action requested by the Service Manager
65 def execute(self, command):
67 cmd = command.split(":")
70 self.mouse_srv.execute(cmd[1])
71 elif cmd[0] == "Keyboard":
72 self.keyboard_srv.execute(cmd[1])
73 elif cmd[0] == "Player":
76 self.player_srv.execute(cmd)
78 self.player_srv.execute(cmd)
80 def set_address_to_download(self, addr):
83 # clean all button and keys pressed
85 self.mouse_srv.clean_up()
86 self.keyboard_srv.clean_up()
89 if __name__ == '__main__':
90 import utils.plistparser