[Bugs] #407 UNSP: Set keyboard layout from control panel

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Wed Aug 19 11:27:37 EDT 2009


#407: Set keyboard layout from control panel
------------------------------------------+---------------------------------
    Reporter:  alsroot                    |          Owner:  erikos           
        Type:  defect                     |         Status:  assigned         
    Priority:  Unspecified by Maintainer  |      Milestone:  0.86             
   Component:  sugar                      |        Version:  Git as of bugdate
    Severity:  Unspecified                |     Resolution:                   
    Keywords:  r!                         |   Distribution:  SoaS             
Status_field:  New                        |  
------------------------------------------+---------------------------------
Changes (by erikos):

  * keywords:  r? => r!


Comment:

 Just some nitpicks that can be done, while I read through all the code: As
 Tomeu likes to point out: Don't use abbreviations.

 Example:
 {{{
 def get_current_layouts(self):
         """Return the enabled keyboard layouts with variants"""
         layouts = self._gconf_client.get_list(_LAYOUTS_KEY, 'string')
         if layouts:
             return layouts

         layouts = self._configrec.get_layouts()
         variants = self._configrec.get_variants()

         ret = []
         i = 0
         for layout in layouts:
             if len(variants) <= i or variants[i] == '':
                 ret.append('%s(%s)' % (layout, ''))
             else:
                 ret.append('%s(%s)' % (layout, variants[i]))
             i += 1

         return ret
 }}}

 or

 {{{
 desc = 'Default layout, %s' % item.get_description()
 }}}

 Run again pylint over it, and best the pep8 as well.
 {{{
 [erikos at laptop sugar]$ pylint ../sugar-
 xkb/extensions/cpsection/keyboard/view.py
 ************* Module view
 W0622:106:LayoutCombo.get_layout: Redefining built-in 'iter'
 W0704:225:Keyboard.__kmodel_timeout_cb: Except doesn't do anything
 W0702:226:Keyboard.__kmodel_timeout_cb: No exception type(s) specified
 W0704:290:Keyboard.__group_switch_timeout_cb: Except doesn't do anything
 W0702:291:Keyboard.__group_switch_timeout_cb: No exception type(s)
 specified
 W0704:397:Keyboard.__layout_timeout_cb: Except doesn't do anything
 W0702:398:Keyboard.__layout_timeout_cb: No exception type(s) specified
 }}}

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/407#comment:10>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list