1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
7 __author__
= 'Michal Čihař'
8 __email__
= 'michal@cihar.com'
10 Copyright © 2003 - 2010 Michal Čihař
12 This program is free software; you can redistribute it and/or modify it
13 under the terms of the GNU General Public License version 2 as published by
14 the Free Software Foundation.
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 class GetMemory(Wammu
.Reader
.Reader
):
31 def __init__(self
, win
, sm
, datatype
, type):
32 Wammu
.Reader
.Reader
.__init
__(self
, win
, sm
)
33 self
.datatype
= datatype
36 def FallBackStatus(self
):
37 if self
.type in ['MC', 'DC', 'RC']:
38 # guess smaller values for calls, as this memory is usually much smaller
41 return Wammu
.Reader
.Reader
.FallBackStatus(self
)
44 status
= self
.sm
.GetMemoryStatus(Type
= self
.type)
47 def GetNextStart(self
):
48 return self
.sm
.GetNextMemory(Start
= True, Type
= self
.type)
50 def GetNext(self
, location
):
51 return self
.sm
.GetNextMemory(Location
= location
, Type
= self
.type)
53 def Get(self
, location
):
54 return self
.sm
.GetMemory(Location
= location
, Type
= self
.type)
56 def Parse(self
, value
):
57 Wammu
.Utils
.ParseMemoryEntry(value
, self
.win
.cfg
)
60 self
.SendData([self
.datatype
, self
.type], data
)