[Bugs] #3233 UNSP: Typing Turtle does not recognize different keyboards

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Thu Nov 17 14:48:22 EST 2011


#3233: Typing Turtle does not recognize different keyboards
------------------------------------------+---------------------------------
    Reporter:  godiard                    |          Owner:  manuq                      
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  TypingTurtle               |        Version:  Unspecified                
    Severity:  Unspecified                |       Keywords:                             
Distribution:  Unspecified                |   Status_field:  Unconfirmed                
------------------------------------------+---------------------------------

Comment(by manuq):

 This is my solution for part 1:

 {{{
 KEYBOARD_MODEL_PATHS = [
     '/ofw/mfg-data/KM', # XO-1, XO-1.5
     '/proc/device-tree/mfg-data/KM', # XO-1.75
 ]

 def is_membrane():
     """Check via the filesystem if the keyboard is non-membrane.

     Keyboard code is 'olpcm' for non-membrane, mechanical keyboard,
     and 'olpc' for membrane keyboard.

     """

     result = True

     def get_keyboard_model_code(f):
         """Return the code in the file, remove the last character."""
         return open(f).read()[:-1]

     for test_path in KEYBOARD_MODEL_PATHS:
         if os.path.exists(test_path):
             code = get_keyboard_model_code(test_path)
             if code == 'olpcm':
                 result = False
                 break

     return result
 }}}

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/3233#comment:2>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list