Sandro Bonazzola has uploaded a new change for review. Change subject: packaging: setup: added summary to engine-cleanup-2 ......................................................................
packaging: setup: added summary to engine-cleanup-2 moved dialog summary from ovirt-engine-setup to ovirt-engine-common allowing engine-cleanup-2 to have a summary. Change-Id: I894abbd6aab0e2840b164f7a361ed471a9edd961 Signed-off-by: Sandro Bonazzola <[email protected]> --- A packaging/setup/plugins/ovirt-engine-common/dialog/__init__.py A packaging/setup/plugins/ovirt-engine-common/dialog/titles.py M packaging/setup/plugins/ovirt-engine-remove/core/misc.py M packaging/setup/plugins/ovirt-engine-setup/dialog/titles.py 4 files changed, 115 insertions(+), 21 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/14701/1 diff --git a/packaging/setup/plugins/ovirt-engine-common/dialog/__init__.py b/packaging/setup/plugins/ovirt-engine-common/dialog/__init__.py new file mode 100644 index 0000000..ed67b18 --- /dev/null +++ b/packaging/setup/plugins/ovirt-engine-common/dialog/__init__.py @@ -0,0 +1,33 @@ +# +# ovirt-engine-setup -- ovirt engine setup +# Copyright (C) 2013 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +"""ovirt-host-setup dialog plugin.""" + + +from otopi import util + + +from . import titles + + [email protected] +def createPlugins(context): + titles.Plugin(context=context) + + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-common/dialog/titles.py b/packaging/setup/plugins/ovirt-engine-common/dialog/titles.py new file mode 100644 index 0000000..91b5760 --- /dev/null +++ b/packaging/setup/plugins/ovirt-engine-common/dialog/titles.py @@ -0,0 +1,67 @@ +# +# ovirt-engine-setup -- ovirt engine setup +# Copyright (C) 2013 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +"""Titles plugin.""" + + +import gettext +_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') + + +from otopi import util +from otopi import plugin + + +from ovirt_engine_setup import constants as osetupcons + + [email protected] +class Plugin(plugin.PluginBase): + """Titles plugin.""" + + def _title(self, text): + self.dialog.note( + text='\n--== %s ==--\n\n' % text, + ) + + def __init__(self, context): + super(Plugin, self).__init__(context=context) + + @plugin.event( + stage=plugin.Stages.STAGE_CLOSEUP, + name=osetupcons.Stages.DIALOG_TITLES_S_SUMMARY, + ) + def _title_s_summary(self): + self._title( + text=_('SUMMARY'), + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CLOSEUP, + name=osetupcons.Stages.DIALOG_TITLES_E_SUMMARY, + after=[ + osetupcons.Stages.DIALOG_TITLES_S_SUMMARY, + ], + ) + def _title_e_summary(self): + self._title( + text=_('END OF SUMMARY'), + ) + + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-remove/core/misc.py b/packaging/setup/plugins/ovirt-engine-remove/core/misc.py index 1f286c9..5dd2485 100644 --- a/packaging/setup/plugins/ovirt-engine-remove/core/misc.py +++ b/packaging/setup/plugins/ovirt-engine-remove/core/misc.py @@ -83,5 +83,20 @@ state=False, ) + @plugin.event( + stage=plugin.Stages.STAGE_CLOSEUP, + before=[ + osetupcons.Stages.DIALOG_TITLES_E_SUMMARY, + ], + after=[ + osetupcons.Stages.DIALOG_TITLES_S_SUMMARY, + ], + ) + def _closeup(self): + self.dialog.note( + text=_( + 'Engine setup successfully cleaned up' + ), + ) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/dialog/titles.py b/packaging/setup/plugins/ovirt-engine-setup/dialog/titles.py index c2a1df6..17594bb 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/dialog/titles.py +++ b/packaging/setup/plugins/ovirt-engine-setup/dialog/titles.py @@ -173,26 +173,5 @@ text=_('END OF CONFIGURATION'), ) - @plugin.event( - stage=plugin.Stages.STAGE_CLOSEUP, - name=osetupcons.Stages.DIALOG_TITLES_S_SUMMARY, - ) - def _title_s_summary(self): - self._title( - text=_('SUMMARY'), - ) - - @plugin.event( - stage=plugin.Stages.STAGE_CLOSEUP, - name=osetupcons.Stages.DIALOG_TITLES_E_SUMMARY, - after=[ - osetupcons.Stages.DIALOG_TITLES_S_SUMMARY, - ], - ) - def _title_e_summary(self): - self._title( - text=_('END OF SUMMARY'), - ) - # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit http://gerrit.ovirt.org/14701 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I894abbd6aab0e2840b164f7a361ed471a9edd961 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sandro Bonazzola <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
