Package gammu :: Module _gammu
[hide private]
[frames] | no frames]

Module _gammu

Module wrapping Gammu functions. Gammu is software for communication with GSM phones allowing work with most of data stored in them. Most of functionality is hidden in StateMachine class which does all phone communication.

This documentation describes python-gammu 1.26.1.

This python-gammu has been compiled with Gammu 1.26.1.

Functions [hide private]
hash
DecodeICS(Text)
Decodes todo/calendar entry v from a string.
hash
DecodeSMS(Messages, EMS)
Decodes multi part SMS message.
hash
DecodeVCARD(Text)
Decodes memory entry v from a string.
hash
DecodeVCS(Text)
Decodes todo/calendar entry v from a string.
string
EncodeICALENDAR(Entry)
Encodes memory entry to a iCalendar.
string
EncodeITODO(Entry)
Encodes memory entry to a iTodo.
dict
EncodeSMS(MessageInfo)
Encodes multi part SMS message.
string
EncodeVCALENDAR(Entry)
Encodes memory entry to a vCalendar.
string
EncodeVCARD(Entry)
Encodes memory entry to a vCard.
string
EncodeVTODO(Entry)
Encodes memory entry to a vTodo.
list
LinkSMS(Messages, EMS)
Links multi part SMS messages.
dict
ReadBackup(Filename, Format)
Reads backup into file.
list
ReadSMSBackup(Filename)
Reads SMS backup into file.
None
SaveBackup(Filename, Backup, Format)
Saves backup into file.
None
SaveRingtone(Filename, Ringtone, Format)
Saves ringtone into file.
None
SaveSMSBackup(Filename, Backup)
Saves SMS backup into file.
None
SetDebugFile(File)
Sets global debug file.
None
SetDebugLevel(Level)
Sets global debug level accorting to passed string.
tuple
Version()
Get version information.
Variables [hide private]
  ErrorNumbers = {1: 'ERR_NONE', 2: 'ERR_DEVICEOPENERROR', 3: 'E...
Mapping of gammu error codes to text representation.
  Errors = {'ERR_BADFEATURE': 61, 'ERR_BUG': 37, 'ERR_BUSY': 66,...
Mapping of text representation of errors to gammu error codes.
  __package__ = None
Function Details [hide private]

DecodeICS(Text)

 

Decodes todo/calendar entry v from a string.

Parameters:
  • Text (string) - String to decode
Returns: hash
Calendar or todo entry (whatever one was included in string)

DecodeSMS(Messages, EMS)

 

Decodes multi part SMS message.

Parameters:
  • Messages (list) - Nessages to decode
  • EMS (boolean) - Whether to use EMS, defalt to True
Returns: hash
Multi part message information

DecodeVCARD(Text)

 

Decodes memory entry v from a string.

Parameters:
  • Text (string) - String to decode
Returns: hash
Memory entry

DecodeVCS(Text)

 

Decodes todo/calendar entry v from a string.

Parameters:
  • Text (string) - String to decode
Returns: hash
Calendar or todo entry (whatever one was included in string)

EncodeICALENDAR(Entry)

 

Encodes memory entry to a iCalendar.

Parameters:
  • Entry (dict) - Memory entry
Returns: string
String with iCalendar

EncodeITODO(Entry)

 

Encodes memory entry to a iTodo.

Parameters:
  • Entry (dict) - Memory entry
Returns: string
String with vCard

EncodeSMS(MessageInfo)

 

Encodes multi part SMS message.

Parameters:
  • MessageInfo (dict) - Description of message
Returns: dict
Dictionary with raw message

EncodeVCALENDAR(Entry)

 

Encodes memory entry to a vCalendar.

Parameters:
  • Entry (dict) - Memory entry
Returns: string
String with vCalendar

EncodeVCARD(Entry)

 

Encodes memory entry to a vCard.

Parameters:
  • Entry (dict) - Memory entry
Returns: string
String with vCard

EncodeVTODO(Entry)

 

Encodes memory entry to a vTodo.

Parameters:
  • Entry (dict) - Memory entry
Returns: string
String with vTodo

LinkSMS(Messages, EMS)

 

Links multi part SMS messages.

Parameters:
  • Messages (list) - List of messages to link
  • EMS (boolean) - Whether to detect ems, defauls to True
Returns: list
List of linked messages

ReadBackup(Filename, Format)

 

Reads backup into file.

Parameters:
  • Filename (string) - Name of file where backup is stored
  • Format (string (Auto, AutoUnicode, LMB, VCalendar, VCard, LDIF, ICS, Gammu, GammuUnicode)) - File format to use (default is AutoUnicode)
Returns: dict
Dictionary of read entries, it contains following keys, each might be empty:
  • IMEI
  • Model
  • Creator
  • PhonePhonebook
  • SIMPhonebook
  • Calendar
  • ToDo
  • DateTime

ReadSMSBackup(Filename)

 

Reads SMS backup into file.

Parameters:
  • Filename (string) - Name of file where SMS backup is stored
Returns: list
List of messages read from file

SaveBackup(Filename, Backup, Format)

 

Saves backup into file.

Parameters:
  • Filename (string) - Name of file to read backup from
  • Backup (dict) - Backup data, see ReadBackup for description
  • Format (string (Auto, AutoUnicode, LMB, VCalendar, VCard, LDIF, ICS, Gammu, GammuUnicode)) - File format to use (default is AutoUnicode)
Returns: None
None

SaveRingtone(Filename, Ringtone, Format)

 

Saves ringtone into file.

Parameters:
  • Filename (string) - Name of file where ringote will be saved
  • Ringtone (dict) - Ringtone to save
  • Format (string) - One of 'ott', 'mid', 'rng', 'imy', 'wav', 'rttl'
Returns: None
None

SaveSMSBackup(Filename, Backup)

 

Saves SMS backup into file.

Parameters:
  • Filename (string) - Name of file where to save SMS backup
  • Backup (list) - List of messages to store
Returns: None
None

SetDebugFile(File)

 

Sets global debug file.

Parameters:
  • File (mixed) - File where to write debug stuff (as configured by SetDebugLevel). Can be either None for no file, Python file object or filename.
Returns: None
None

SetDebugLevel(Level)

 

Sets global debug level accorting to passed string. You need to configure output file using SetDebugFile to activate it.

Parameters:
  • Level (string) - name of debug level to use, currently one of:
    • nothing
    • text
    • textall
    • binary
    • errors
    • textdate
    • textalldate
    • errorsdate
Returns: None
None

Version()

 

Get version information.

Returns: tuple
Tuple of version information - Gammu runtime version, python-gammu version, build time Gammu version.

Variables Details [hide private]

ErrorNumbers

Mapping of gammu error codes to text representation. Reverse to Errors.
Value:
{1: 'ERR_NONE',
 2: 'ERR_DEVICEOPENERROR',
 3: 'ERR_DEVICELOCKED',
 4: 'ERR_DEVICENOTEXIST',
 5: 'ERR_DEVICEBUSY',
 6: 'ERR_DEVICENOPERMISSION',
 7: 'ERR_DEVICENODRIVER',
 8: 'ERR_DEVICENOTWORK',
...

Errors

Mapping of text representation of errors to gammu error codes. Reverse to ErrorNumbers.
Value:
{'ERR_BADFEATURE': 61,
 'ERR_BUG': 37,
 'ERR_BUSY': 66,
 'ERR_CANCELED': 38,
 'ERR_CANTOPENFILE': 28,
 'ERR_CORRUPTED': 60,
 'ERR_DATACONVERTED': 53,
 'ERR_DEVICEBUSY': 5,
...