Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9018

Modified Files:
        joy.py 
Log Message:
only activate plugin when joystick is working

Index: joy.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/joy.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** joy.py      4 Oct 2003 18:37:29 -0000       1.10
--- joy.py      8 Jul 2004 12:30:51 -0000       1.11
***************
*** 12,15 ****
--- 12,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.11  2004/07/08 12:30:51  dischi
+ # only activate plugin when joystick is working
+ #
  # Revision 1.10  2003/10/04 18:37:29  dischi
  # i18n changes and True/False usage
***************
*** 21,25 ****
  # removed some old CVS log messages
  #
- #
  # -----------------------------------------------------------------------
  # Freevo - A Home Theater PC framework
--- 24,27 ----
***************
*** 60,97 ****
  
      def __init__(self):
-         plugin.DaemonPlugin.__init__(self)
- 
          self.plugin_name = 'JOY'
          self.device_name = ''
-         # If we make it to the end of __init__ successfully then
-         # poll_interval is set to run ok.
-         self.poll_interval = 0
       
          if config.JOY_DEV == 0:
!             print 'Joystick input module disabled, exiting'
              return
  
!         self.device_name = '/dev/input/js'+str((config.JOY_DEV - 1))
  
          try:
!             self.joyfd = os.open(self.device_name, 
!                                       os.O_RDONLY|os.O_NONBLOCK)
          except OSError:
              print 'Unable to open %s, trying /dev/js%s...' % \
                    (self.device_name, str((config.JOY_DEV - 1)))
!             self.device_name = '/dev/js'+str((config.JOY_DEV - 1))
  
              try:
!                 self.joyfd = os.open(self.device_name, 
!                                           os.O_RDONLY|os.O_NONBLOCK)
              except OSError:
                  print 'Unable to open %s, check modules and/or permissions' % \
                        self.device_name
!                 print 'exiting...'
                  return
!     
          print 'using joystick', config.JOY_DEV
!     
!         self.poll_interval = 1
          self.poll_menu_only = False
  
--- 62,96 ----
  
      def __init__(self):
          self.plugin_name = 'JOY'
          self.device_name = ''
       
          if config.JOY_DEV == 0:
!             self.reason = 'Joystick input module disabled'
              return
  
!         self.device_name = '/dev/input/js' + str((config.JOY_DEV - 1))
  
          try:
!             self.joyfd = os.open(self.device_name, os.O_RDONLY|os.O_NONBLOCK)
          except OSError:
+             
              print 'Unable to open %s, trying /dev/js%s...' % \
                    (self.device_name, str((config.JOY_DEV - 1)))
!             self.device_name = '/dev/js' + str((config.JOY_DEV - 1))
  
              try:
!                 self.joyfd = os.open(self.device_name, os.O_RDONLY|os.O_NONBLOCK)
              except OSError:
                  print 'Unable to open %s, check modules and/or permissions' % \
                        self.device_name
!                 self.reason = 'unable to open device'
                  return
! 
!         # ok, joystick is working
!         plugin.DaemonPlugin.__init__(self)
!         
          print 'using joystick', config.JOY_DEV
!         
!         self.poll_interval  = 1
          self.poll_menu_only = False
  



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to