source: subversion/applications/routing/pyroute/base.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.8 KB
Line 
1#!/usr/bin/python
2#-----------------------------------------------------------------------------
3# Projection code (lat/long to screen conversions)
4#
5# Usage:
6#   * Derive all pyroute modules fom this class
7#   * Put "pyrouteModule.__init__(self,modules)" in your init function
8#   * Instantiate using modules.append(yourmodule(modules))
9#      where "modules" is the list of all pyroute modules
10#
11# Features:
12#   * Get and set data from the global table
13#   * Send messages or trigger events
14#   * Access other modules (using "self.m['modulename']")
15#-----------------------------------------------------------------------------
16# Copyright 2007, Oliver White
17#
18# This program is free software: you can redistribute it and/or modify
19# it under the terms of the GNU General Public License as published by
20# the Free Software Foundation, either version 3 of the License, or
21# (at your option) any later version.
22#
23# This program is distributed in the hope that it will be useful,
24# but WITHOUT ANY WARRANTY; without even the implied warranty of
25# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26# GNU General Public License for more details.
27#
28# You should have received a copy of the GNU General Public License
29# along with this program.  If not, see <http://www.gnu.org/licenses/>.
30#----------------------------------------------------------------------------
31class pyrouteModule:
32  def __init__(self, modules):
33    self.= modules
34  def get(self, name, default=None):
35    return(self.m['data'].getData(name, default))
36  def set(self, name, value):
37    return(self.m['data'].setData(name, value))
38  def action(self, message):
39    self.m['events'].handleEvent(message)
40  def ownPos(self):
41    return(self.m['position'].get())
42  # Meta-info
43  def getStatus(self):
44    return("")
Note: See TracBrowser for help on using the repository browser.