source: subversion/applications/routing/pyroute-dev/base.py @ 18454

Last change on this file since 18454 was 18454, checked in by buerste, 10 years ago

-further updates of spaces to tabs

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