Open nickbattam opened 7 years ago
I also found adding actions to be verbose and repetitive. We have
class ActionWidget
def add_something_command(<something command args>)
self.actions.append(actions.SomethingCommandAction(<something command args>)
Do we need to have 'Action' in the class name as well as the module name. If we're going to add actions to widgets, and there is a class that represents that action, why not pass an instance of that class to represent the action, instead of some bunch of arguments?
Other proposed changes:
Color
without specifiying r,g and bsetup.py
.
The API contains a lot of repetition of words: e.g. in
cssgen.borders.OpiBorderRenderer
self._text_renderer = text_renderer
self._text_renderer.render(...)
and incssgen.render.get_opi_renderer()
tr = OpiTextRenderer()
wr = OpiWidgetRenderer(tr)
cr = colors.OpiColorRenderer()
wr.add_renderer('background_color', cr)
This makes the API unnecessarily verbose.The class, module and package names are not always self explanatory.
Renaming some classes, methods and package could simplify this, e.g.
<renderer>.add_renderer()
to<renderer>.add()
and make it simpler to understand.