~guadalinex-members/hermeshardware/gv5

« back to all changes in this revision

Viewing changes to actors/usbjoystick.py

  • Committer: fontanon
  • Date: 2008-05-31 09:06:24 UTC
  • Revision ID: svn-v4:fecba971-2e3e-0410-8991-b5285d0e4d01:apps/hermes/trunk:297
Joystick added, Mouse improved,doc adapted to Gv5 and several debian-package bugfixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
 
 
3
 
 
4
#Módulo usbjoystick - Módulo que implementa el "actor hardware" para los
 
5
#dispositivos USB Joystick/Gamepad
 
6
#
 
7
#Copyright (C) 2007 Junta de Andalucía
 
8
#
 
9
#Autor/es (Author/s):
 
10
#
 
11
#- J. Félix Ontañón <fontanon@emergya.es>
 
12
#
 
13
#Este fichero es parte de Detección de Hardware de Guadalinex 
 
14
#
 
15
#Detección de Hardware de Guadalinex es software libre. Puede redistribuirlo y/o modificarlo 
 
16
#bajo los términos de la Licencia Pública General de GNU según es 
 
17
#publicada por la Free Software Foundation, bien de la versión 2 de dicha
 
18
#Licencia o bien (según su elección) de cualquier versión posterior. 
 
19
#
 
20
#Detección de Hardware de Guadalinex se distribuye con la esperanza de que sea útil, 
 
21
#pero SIN NINGUNA GARANTÍA, incluso sin la garantía MERCANTIL 
 
22
#implícita o sin garantizar la CONVENIENCIA PARA UN PROPÓSITO 
 
23
#PARTICULAR. Véase la Licencia Pública General de GNU para más detalles. 
 
24
#
 
25
#Debería haber recibido una copia de la Licencia Pública General 
 
26
#junto con Detección de Hardware de Guadalinex . Si no ha sido así, escriba a la Free Software
 
27
#Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
28
#
 
29
#-------------------------------------------------------------------------
 
30
#
 
31
#This file is part of Detección de Hardware de Guadalinex .
 
32
#
 
33
#Detección de Hardware de Guadalinex is free software; you can redistribute it and/or modify
 
34
#it under the terms of the GNU General Public License as published by
 
35
#the Free Software Foundation; either version 2 of the License, or
 
36
#at your option) any later version.
 
37
#
 
38
#Detección de Hardware de Guadalinex is distributed in the hope that it will be useful,
 
39
#but WITHOUT ANY WARRANTY; without even the implied warranty of
 
40
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
41
#GNU General Public License for more details.
 
42
#
 
43
#You should have received a copy of the GNU General Public License
 
44
#along with Foobar; if not, write to the Free Software
 
45
#Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
46
 
 
47
import os.path
 
48
 
 
49
from utils.pkginstaller import PkgInstaller
 
50
from deviceactor import PkgDeviceActor
 
51
from gettext import gettext as _
 
52
 
 
53
 
 
54
def is_valid(value):
 
55
    valid_list = ['usb joystick'] 
 
56
    if (value.lower() in valid_list):
 
57
        return True
 
58
 
 
59
class Actor(PkgDeviceActor):
 
60
 
 
61
    __required__ = {'info.bus':'usb_device',
 
62
            'info.product': is_valid,
 
63
            }
 
64
 
 
65
    # Important for compatibility with usbmouse.py
 
66
    __priority__ = 5
 
67
 
 
68
    __icon_path__  = os.path.abspath('actors/img/usb.png')
 
69
    __iconoff_path__ = os.path.abspath('actors/img/usboff.png')
 
70
 
 
71
    __device_title__ = 'USB Joystick'
 
72
    __device_conn_description__ = _('Joystick/Gamepad connected')
 
73
    __device_disconn_description__ = _('Joystick/Gamepad disconnected')