diff options
Diffstat (limited to 'tcosmonitor/extensions/clean.py')
-rw-r--r-- | tcosmonitor/extensions/clean.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tcosmonitor/extensions/clean.py b/tcosmonitor/extensions/clean.py new file mode 100644 index 0000000..2aa63c9 --- /dev/null +++ b/tcosmonitor/extensions/clean.py @@ -0,0 +1,58 @@ +# -*- coding: UTF-8 -*- +# TcosMonitor version __VERSION__ +# +# Copyright (c) 2006-2011 Mario Izquierdo <mariodebian@gmail.com> +# +# This package is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# +# This package is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +""" template extension """ + +from gettext import gettext as _ +import sys + +from tcosmonitor import shared +from tcosmonitor.TcosExtensions import TcosExtension + + +def print_debug(txt): + if shared.debug: + print >> sys.stderr, "%s::%s" % (__name__, txt) + #print("%s::%s" % (__name__, txt), file=sys.stderr) + + +class Clean(TcosExtension): + def register(self): + self.main.menus.register_simple(_("Clean info about terminal"), "menu_clear.png", 0, self.clean, "clean") + self.main.menus.register_all( _("Clean info about terminal"), "menu_clear.png", 0, self.clean, "clean") + + def clean(self, *args): + print_debug("clean()") + self.main.datatxt.clean() + self.main.write_into_statusbar('') + + + + + + +__extclass__=Clean + + + + + + + + |