1
# Copyright (C) 2004,2005 PreludeIDS Technologies. All Rights Reserved.
2
# Author: Nicolas Delon <nicolas.delon@prelude-ids.com>
4
# This file is part of the Prewikka program.
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2, or (at your option)
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program; see the file COPYING. If not, write to
18
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25
def __setitem__(self, key, value):
26
keys = key.split(".", 1)
28
dict.__setitem__(self, key, value)
31
if not self.has_key(key1):
32
dict.__setitem__(self, key1, DataSet())
33
dict.__getitem__(self, key1)[key2] = value
35
def __getitem__(self, key):
37
keys = key.split(".", 1)
39
return dict.__getitem__(self, key)
40
return dict.__getitem__(self, keys[0])[keys[1]]