source: subversion/applications/routing/pyroute/meta.py

Last change on this file was 5947, checked in by ojw, 12 years ago

"meta" menu, will list all the modules in use, and allow each one to
display status, memory use, cache size, warnings, etc.

File size: 1.5 KB
Line 
1#!/usr/bin/python
2#-----------------------------------------------------------------------------# Meta-information (self-testing, self-diagnosis, etc.) for pyroute
3#
4# Usage:
5#   Library for pyroute
6#-----------------------------------------------------------------------------
7# Copyright 2007, Oliver White
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program.  If not, see <http://www.gnu.org/licenses/>.
21#----------------------------------------------------------------------------
22from base import pyrouteModule
23from listable import *
24
25class moduleInfo(pyrouteModule, listable):
26  def __init__(self, modules):
27    pyrouteModule.__init__(self, modules)
28   
29  def numItems(self):
30    return(len(self.m))
31  def getItemText(self,n):
32    return("Module: \"%s\"" % (self.m.keys()[n]))
33  def getItemStatus(self,n):
34    module = self.m.values()[n]
35    if("getStatus" in dir(module)):
36      return module.getStatus();
37    return("")
38  def getItemClickable(self,n):
39    return(True)
40  def getItemAction(self,n):
41    return("")
Note: See TracBrowser for help on using the repository browser.