Skip to content

Commit

Permalink
Better ident code
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Barnada committed Sep 18, 2018
1 parent 53c29cb commit c4bc4a5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Koo/Screen/Screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,22 @@ def addViewByIdAndType(self, id, type, display=False):
:return:
"""
if type in self.views_preload:
return self.addView(self.views_preload[type]['arch'], self.views_preload[type]['fields'], display, toolbar=self.views_preload[type].get('toolbar', False), ident=self.views_preload[type].get('view_id', False))
return self.addView(
self.views_preload[type]['arch'],
self.views_preload[type]['fields'], display,
toolbar=self.views_preload[type].get('toolbar', False),
ident=self.views_preload[type].get('view_id', False)
)
else:
# By now we set toolbar to True always. Even when the Screen is embedded.
# This way we don't force setting the embedded option in the class constructor
# and can be set later.
view = self.rpc.fields_view_get(id, type, self.context, True)
return self.addView(view['arch'], view['fields'], display, toolbar=view.get('toolbar', False), ident=view.get('view_id', False))
return self.addView(
view['arch'], view['fields'], display,
toolbar=view.get('toolbar', False),
ident=view.get('view_id', False)
)

def addViewById(self, id, display=False):
"""
Expand Down

0 comments on commit c4bc4a5

Please sign in to comment.