#560 HIGH Opportu: Pylint sugar

Zarro Boogs per Child bugtracker at laptop.org
Mon Feb 18 10:30:32 EST 2008


#560: Pylint sugar
---------------------+------------------------------------------------------
  Reporter:  marco   |       Owner:  erikos     
      Type:  defect  |      Status:  new        
  Priority:  high    |   Milestone:  Opportunity
 Component:  sugar   |     Version:             
Resolution:          |    Keywords:             
  Verified:  0       |    Blocking:             
 Blockedby:          |  
---------------------+------------------------------------------------------

Comment(by erikos):

 (this comment is better formatted)

 I went through the errors I get with pylint for the sugar shell. Here are
 the ones we get false errors.

 * hippocanvas
  * python/hippo.override
  * change line 30 to 'hippo'
  * Action item: marco can you fix this upstream?

 * dbus conversion
  * dbus.String(self._key)
  * E1102: dbus.String is not callable
  * works in 0.41

 * Message has unused arguments
  * W0613: Unused argument 'arg0'
 {{{
 def __new_picture(self, playa, pixbuf):
         self.emit('pixbuf', pixbuf)
 }}}
  - workaround: prefix method with 'cb_' or append '_cb', this seems
 hardcoded in the pylint code why I think this can not be customized.

 * gobject
  * E1101: Instance of 'LiveVideoSlot' has no 'emit' member
  * same behavior for 'connect', 'disconnect', 'notify', props

 What does not work:
 {{{
 class LiveVideoSlot(gobject.GObject):
     __gsignals__ = {
         'pixbuf': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
 ([gobject.TYPE_PYOBJECT])),
     }
     def __init__(self, width, height):
         gobject.GObject.__init__(self)

     def _new_picture_cb(self, playa, pixbuf):
         self.emit('pixbuf', pixbuf)
 }}}

 What does work:
 {{{
 class LiveVideoSlot(gtk.EventBox):
     __gsignals__ = {
         'pixbuf': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
 ([gobject.TYPE_PYOBJECT])),
     }
     def __init__(self, width, height):
         gtk.EventBox.__init__(self)

     def _new_picture_cb(self, playa, pixbuf):
         self.emit('pixbuf', pixbuf)
 }}}

 * vbox keydialog
  * E1101: 96:KeyDialog.__init__: Class 'vbox' has no 'pack_start' member
  * self.vbox.__module__ is gtk
 {{{
 class KeyDialog(gtk.Dialog):
     def __init__(self):
         gtk.Dialog.__init__(self, flags=gtk.DIALOG_MODAL)
         self.set_title("Wireless Key Required")
         label = gtk.Label("Label")
         self.vbox.pack_start(label)
 }}}

 * gtk.Window
  * E1101: 10:ActivityChatWindow.__init__: Class 'window' has no
 'set_type_hint' member
  * E1101: 11:ActivityChatWindow.__init__: Class 'window' has no
 'set_accept_focus' member
  * calling self.set_type_hint() works for pylint
  * self.window.__module__ is gtk.gdk
 {{{
 class ActivityChatWindow(gtk.Window):
     def __init__(self):
         gtk.Window.__init__(self)

         self.realize()
         self.set_decorated(False)
         self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
         self.window.set_accept_focus(True)
 ActivityChatWindow()
 }}}

 * child
  * E1101: 10:ClipboardIcon.__init__: Class 'child' has no 'connect' member
  * calling self.connect() works for pylint
  * self.child is of type GtkRadioButton and __module__ is gtk

 {{{
 from sugar.graphics.radiotoolbutton import RadioToolButton

 class ClipboardIcon(RadioToolButton):
     __gtype_name__ = 'SugarClipboardIcon'

     def __init__(self):
         RadioToolButton.__init__(self)
         self.child.connect('drag_data_get', self._drag_data_get_cb)

     def _drag_data_get_cb(self, widget, context, selection, targetType,
 eventTime):
         pass
 }}}

 * sugar.src.view.BuddyMenu (GtkMenuShell)
  * E1101: 65:BuddyMenu._add_items: Instance of '_Menu' has no 'append'
 member
 {{{
 palette.menu.__module__
 'sugar.graphics.palette'
 }}}

-- 
Ticket URL: <http://dev.laptop.org/ticket/560#comment:11>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list