def set_drawparams_cb(self):
        if self.canvas.get_draw_mode() != 'draw':
            # if we are in edit mode then don't initialize draw gui
            return
        index = self.w.draw_type.get_index()
        kind = self.drawtypes[index]
        index = self.w.coord_type.get_index()
        coord = self.coordtypes[index]

        # remove old params
        self.w.drawvbox.remove_all()

        # Create new drawing class of the right kind
        drawClass = self.canvas.getDrawClass(kind)

        self.w.attrlbl.set_text((kind) % "New Object: %s")
        # Build up a set of control widgets for the parameters
        # of the canvas object to be drawn
        paramlst = drawClass.get_params_metadata()

        params = self.drawparams_cache.setdefault(kind, Bunch.Bunch())
        self.draw_params = ParamSet.ParamSet(self.logger, params)

        w = self.draw_params.build_params(paramlst,
                                          orientation=self.orientation)
        self.draw_params.add_callback('changed', self.draw_params_changed_cb)

        self.w.drawvbox.add_widget(w, stretch=1)

        # disable edit-only controls
        self.w.delete_obj.set_enabled(False)
        self.w.scale_by.set_enabled(False)
        self.w.rotate_by.set_enabled(False)

        args, kwdargs = self.draw_params.get_params()
        #self.logger.debug("changing params to: %s" % str(kwdargs))
        if kind != 'compass':
            kwdargs['coord'] = coord
        self.canvas.set_drawtype(kind, **kwdargs)
dataset/ETHPy150Open ejeschke/ginga/ginga/misc/plugins/Drawing.py/Drawing.set_drawparams_cb/swapped operands of `%`