source: subversion/applications/routing/pyroute-dev/dataStore.py @ 18449

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

-adding rev replacement

  • Property svn:keywords set to Rev
File size: 1.4 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""Global data table
5
6Usage:
7  (library code for pyroute GUI, not for direct use)
8
9Types of data stored:
10  * Options and settings
11  * Data (e.g. current position)
12  * Event-related data (e.g. position of last click)
13
14Not stored here:
15  * Routes (internal within the routing module)
16  * POIs and map data
17
18TODO:
19  * Event handling code needs to be moved into a module
20"""
21
22__version__ = "$Rev: 18449 $"
23__license__ = """This program is free software: you can redistribute it and/or modify
24it under the terms of the GNU General Public License as published by
25the Free Software Foundation, either version 3 of the License, or
26(at your option) any later version.
27
28This program is distributed in the hope that it will be useful,
29but WITHOUT ANY WARRANTY; without even the implied warranty of
30MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31GNU General Public License for more details.
32
33You should have received a copy of the GNU General Public License
34along with this program. If not, see <http://www.gnu.org/licenses/>."""
35_debug = 0
36
37
38from base import pyrouteModule
39
40class DataStore(pyrouteModule):
41        def __init__(self, modules):
42                pyrouteModule.__init__(self,modules)
43                self.options = {}
44       
45        def getData(self,name,default=None):
46                return(self.options.get(name,default))
47       
48        def setData(self,name,value):
49                self.options[name] = value
Note: See TracBrowser for help on using the repository browser.