commit python-python-gammu for openSUSE:Factory
Hello community, here is the log from the commit of package python-python-gammu for openSUSE:Factory checked in at 2016-05-31 12:24:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-python-gammu (Old) and /work/SRC/openSUSE:Factory/.python-python-gammu.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-python-gammu" Changes: -------- --- /work/SRC/openSUSE:Factory/python-python-gammu/python-python-gammu.changes 2015-09-30 05:50:32.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-python-gammu.new/python-python-gammu.changes 2016-05-31 12:24:50.000000000 +0200 @@ -1,0 +2,6 @@ +Sat May 28 10:23:27 UTC 2016 - ecsos@opensuse.org + +- Update to 2.5: + * Compatibility with Gammu >= 1.36.7 + +------------------------------------------------------------------- Old: ---- python-gammu-2.4.tar.bz2 New: ---- python-gammu-2.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-gammu.spec ++++++ --- /var/tmp/diff_new_pack.qelJYX/_old 2016-05-31 12:24:51.000000000 +0200 +++ /var/tmp/diff_new_pack.qelJYX/_new 2016-05-31 12:24:51.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-python-gammu # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-python-gammu -Version: 2.4 +Version: 2.5 Release: 0 Summary: Python module to communicate with mobile phones License: GPL-2.0+ ++++++ python-gammu-2.4.tar.bz2 -> python-gammu-2.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/NEWS.rst new/python-gammu-2.5/NEWS.rst --- old/python-gammu-2.4/NEWS.rst 2015-09-02 10:02:50.000000000 +0200 +++ new/python-gammu-2.5/NEWS.rst 2016-01-19 14:42:44.000000000 +0100 @@ -1,3 +1,8 @@ +2.5 +=== + +* Compatibility with Gammu >= 1.36.7 + 2.4 === diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/PKG-INFO new/python-gammu-2.5/PKG-INFO --- old/python-gammu-2.4/PKG-INFO 2015-09-02 10:21:00.000000000 +0200 +++ new/python-gammu-2.5/PKG-INFO 2016-01-19 15:17:05.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-gammu -Version: 2.4 +Version: 2.5 Summary: Gammu bindings Home-page: http://wammu.eu/python-gammu/ Author: Michal Čihař @@ -14,7 +14,7 @@ :target: https://travis-ci.org/gammu/python-gammu .. image:: https://www.codacy.com/project/badge/c7e87df480fb4609aa48482873f5c46b - :target: https://www.codacy.com/public/michal_2/python-gammu_2 + :target: https://www.codacy.com/public/nijel/python-gammu .. image:: https://scrutinizer-ci.com/g/gammu/python-gammu/badges/quality-score.png?b=m... :target: https://scrutinizer-ci.com/g/gammu/python-gammu/?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/README.rst new/python-gammu-2.5/README.rst --- old/python-gammu-2.4/README.rst 2015-06-03 08:59:15.000000000 +0200 +++ new/python-gammu-2.5/README.rst 2016-01-19 14:25:58.000000000 +0100 @@ -5,7 +5,7 @@ :target: https://travis-ci.org/gammu/python-gammu .. image:: https://www.codacy.com/project/badge/c7e87df480fb4609aa48482873f5c46b - :target: https://www.codacy.com/public/michal_2/python-gammu_2 + :target: https://www.codacy.com/public/nijel/python-gammu .. image:: https://scrutinizer-ci.com/g/gammu/python-gammu/badges/quality-score.png?b=m... :target: https://scrutinizer-ci.com/g/gammu/python-gammu/?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/examples/sendlongsms.py new/python-gammu-2.5/examples/sendlongsms.py --- old/python-gammu-2.4/examples/sendlongsms.py 2015-06-03 09:18:33.000000000 +0200 +++ new/python-gammu-2.5/examples/sendlongsms.py 2016-01-19 14:25:58.000000000 +0100 @@ -50,7 +50,7 @@ # Create SMS info structure smsinfo = { - 'Class': 1, + 'Class': -1, 'Unicode': False, 'Entries': [ { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/examples/service_numbers.py new/python-gammu-2.5/examples/service_numbers.py --- old/python-gammu-2.4/examples/service_numbers.py 2015-06-03 09:18:33.000000000 +0200 +++ new/python-gammu-2.5/examples/service_numbers.py 2016-01-19 14:25:58.000000000 +0100 @@ -28,15 +28,20 @@ import gammu import sys +REPLY = False + def callback(state_machine, callback_type, data): ''' Callback on USSD data. ''' + global REPLY if callback_type != 'USSD': print('Unexpected event type: %s' % callback_type) sys.exit(1) + REPLY = True + print('Network reply:') print('Status: %s' % data['Status']) print(data['Text']) @@ -68,15 +73,25 @@ ''' Main code to talk with worker. ''' + global REPLY + if len(sys.argv) >= 3: code = sys.argv[2] del sys.argv[2] else: - print('Enter code (empty string to end):', end=' ') - code = input() + prompt = 'Enter code (empty string to end): ' + try: + code = raw_input(prompt) + except NameError: + code = input(prompt) if code != '': print('Talking to network...') + REPLY = False state_machine.DialService(code) + loops = 0 + while not REPLY and loops < 10: + state_machine.ReadDevice() + loops += 1 def main(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/gammu/src/gammu.c new/python-gammu-2.5/gammu/src/gammu.c --- old/python-gammu-2.4/gammu/src/gammu.c 2015-09-02 10:12:56.000000000 +0200 +++ new/python-gammu-2.5/gammu/src/gammu.c 2016-01-19 14:25:58.000000000 +0100 @@ -199,7 +199,15 @@ */ static void SendSMSStatus (GSM_StateMachine *s, int status, int mr, void *user) { StateMachineObject *sm = (StateMachineObject *)user; - if (sm == NULL) return; + + if (sm == NULL) { + pyg_error("Received callback without user pointer!\n"); + return; + } + if (sm->s != s) { + pyg_error("Callback user pointer doesn't match state machine!\n"); + return; + } sm->MessageReference = mr; if (status == 0) { @@ -216,9 +224,17 @@ */ static void IncomingCall (GSM_StateMachine *s, GSM_Call *call, void *user) { StateMachineObject *sm = (StateMachineObject *)user; + GSM_Call *message; int i = 0; - if (sm == NULL) return; + if (sm == NULL) { + pyg_error("Received callback without user pointer!\n"); + return; + } + if (sm->s != s) { + pyg_error("Callback user pointer doesn't match state machine!\n"); + return; + } while (i < MAX_EVENTS && sm->IncomingCallQueue[i] != NULL) i++; @@ -227,10 +243,13 @@ return; } - sm->IncomingCallQueue[i] = (GSM_Call *)malloc(sizeof(GSM_Call)); - if (sm->IncomingCallQueue[i] == NULL) return; + message = malloc(sizeof(GSM_Call)); + if (message == NULL) return; - *(sm->IncomingCallQueue[i]) = *call; + *message = *call; + + sm->IncomingCallQueue[i + 1] = NULL; + sm->IncomingCallQueue[i] = message; } /** @@ -238,9 +257,17 @@ */ static void IncomingSMS (GSM_StateMachine *s, GSM_SMSMessage *msg, void *user) { StateMachineObject *sm = (StateMachineObject *)user; + GSM_SMSMessage *message; int i = 0; - if (sm == NULL) return; + if (sm == NULL) { + pyg_error("Received callback without user pointer!\n"); + return; + } + if (sm->s != s) { + pyg_error("Callback user pointer doesn't match state machine!\n"); + return; + } while (i < MAX_EVENTS && sm->IncomingSMSQueue[i] != NULL) i++; @@ -249,10 +276,13 @@ return; } - sm->IncomingSMSQueue[i] = (GSM_SMSMessage *)malloc(sizeof(GSM_SMSMessage)); - if (sm->IncomingSMSQueue[i] == NULL) return; + message = malloc(sizeof(GSM_SMSMessage)); + if (message == NULL) return; - *(sm->IncomingSMSQueue[i]) = *msg; + *message = *msg; + + sm->IncomingSMSQueue[i + 1] = NULL; + sm->IncomingSMSQueue[i] = message; } /** @@ -260,9 +290,17 @@ */ static void IncomingCB (GSM_StateMachine *s, GSM_CBMessage *cb, void *user) { StateMachineObject *sm = (StateMachineObject *)user; + GSM_CBMessage *message; int i = 0; - if (sm == NULL) return; + if (sm == NULL) { + pyg_error("Received callback without user pointer!\n"); + return; + } + if (sm->s != s) { + pyg_error("Callback user pointer doesn't match state machine!\n"); + return; + } while (i < MAX_EVENTS && sm->IncomingCBQueue[i] != NULL) i++; @@ -271,10 +309,13 @@ return; } - sm->IncomingCBQueue[i] = (GSM_CBMessage *)malloc(sizeof(GSM_CBMessage)); - if (sm->IncomingCBQueue[i] == NULL) return; + message = malloc(sizeof(GSM_CBMessage)); + if (message == NULL) return; + + *message = *cb; - *(sm->IncomingCBQueue[i]) = *cb; + sm->IncomingCBQueue[i + 1] = NULL; + sm->IncomingCBQueue[i] = message; } /** @@ -282,9 +323,17 @@ */ static void IncomingUSSD (GSM_StateMachine *s, GSM_USSDMessage *ussd, void *user) { StateMachineObject *sm = (StateMachineObject *)user; + GSM_USSDMessage *message; int i = 0; - if (sm == NULL) return; + if (sm == NULL) { + pyg_error("Received callback without user pointer!\n"); + return; + } + if (sm->s != s) { + pyg_error("Callback user pointer doesn't match state machine!\n"); + return; + } while (i < MAX_EVENTS && sm->IncomingUSSDQueue[i] != NULL) i++; @@ -293,10 +342,15 @@ return; } - sm->IncomingUSSDQueue[i] = (GSM_USSDMessage *)malloc(sizeof(GSM_USSDMessage)); - if (sm->IncomingUSSDQueue[i] == NULL) return; + pyg_warning("Adding USSD to queue, position %d\n", i); - *(sm->IncomingUSSDQueue[i]) = *ussd; + message = malloc(sizeof(GSM_USSDMessage)); + if (message == NULL) return; + + *message = *ussd; + + sm->IncomingUSSDQueue[i + 1] = NULL; + sm->IncomingUSSDQueue[i] = message; } /** @@ -5533,6 +5587,9 @@ 0, /* tp_weaklist */ 0, /* tp_del */ 0, /* tp_version_tag */ +#ifdef Py_TPFLAGS_HAVE_FINALIZE + 0, /* tp_finalize */ +#endif }; /* End of code for StateMachine objects */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/gammu/src/smsd.c new/python-gammu-2.5/gammu/src/smsd.c --- old/python-gammu-2.4/gammu/src/smsd.c 2015-09-02 09:56:02.000000000 +0200 +++ new/python-gammu-2.5/gammu/src/smsd.c 2015-10-01 17:05:55.000000000 +0200 @@ -301,6 +301,9 @@ 0, /* tp_weaklist */ 0, /* tp_del */ 0, /* tp_version_tag */ +#ifdef Py_TPFLAGS_HAVE_FINALIZE + 0, /* tp_finalize */ +#endif }; /* End of code for SMSD objects */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/python_gammu.egg-info/PKG-INFO new/python-gammu-2.5/python_gammu.egg-info/PKG-INFO --- old/python-gammu-2.4/python_gammu.egg-info/PKG-INFO 2015-09-02 10:21:00.000000000 +0200 +++ new/python-gammu-2.5/python_gammu.egg-info/PKG-INFO 2016-01-19 15:17:05.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-gammu -Version: 2.4 +Version: 2.5 Summary: Gammu bindings Home-page: http://wammu.eu/python-gammu/ Author: Michal Čihař @@ -14,7 +14,7 @@ :target: https://travis-ci.org/gammu/python-gammu .. image:: https://www.codacy.com/project/badge/c7e87df480fb4609aa48482873f5c46b - :target: https://www.codacy.com/public/michal_2/python-gammu_2 + :target: https://www.codacy.com/public/nijel/python-gammu .. image:: https://scrutinizer-ci.com/g/gammu/python-gammu/badges/quality-score.png?b=m... :target: https://scrutinizer-ci.com/g/gammu/python-gammu/?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/python_gammu.egg-info/SOURCES.txt new/python-gammu-2.5/python_gammu.egg-info/SOURCES.txt --- old/python-gammu-2.4/python_gammu.egg-info/SOURCES.txt 2015-09-02 10:21:00.000000000 +0200 +++ new/python-gammu-2.5/python_gammu.egg-info/SOURCES.txt 2016-01-19 15:17:05.000000000 +0100 @@ -80,13 +80,15 @@ test/test_sms.py test/test_smsd.py test/test_worker.py +test/data/.sqlite.sql.swp test/data/02.vcs test/data/UK32Holidays.ics test/data/bug-779.vcf test/data/gammu.vcf test/data/k770.vcs test/data/rrule.ics -test/data/sqlite.sql +test/data/sqlite-14.sql +test/data/sqlite-15.sql test/data/gammu-dummy/calendar/2 test/data/gammu-dummy/calendar/22 test/data/gammu-dummy/fs/file5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/setup.py new/python-gammu-2.5/setup.py --- old/python-gammu-2.4/setup.py 2015-06-03 15:06:36.000000000 +0200 +++ new/python-gammu-2.5/setup.py 2015-10-01 15:05:24.000000000 +0200 @@ -30,7 +30,7 @@ import codecs # some defines -VERSION = '2.4' +VERSION = '2.5' GAMMU_REQUIRED = '1.34.0' README_FILE = os.path.join(os.path.dirname(__file__), 'README.rst') with codecs.open(README_FILE, 'r', 'utf-8') as readme: Files old/python-gammu-2.4/test/data/.sqlite.sql.swp and new/python-gammu-2.5/test/data/.sqlite.sql.swp differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/test/data/sqlite-14.sql new/python-gammu-2.5/test/data/sqlite-14.sql --- old/python-gammu-2.4/test/data/sqlite-14.sql 1970-01-01 01:00:00.000000000 +0100 +++ new/python-gammu-2.5/test/data/sqlite-14.sql 2015-03-20 08:40:50.000000000 +0100 @@ -0,0 +1,149 @@ +CREATE TABLE daemons ( + Start TEXT NOT NULL, + Info TEXT NOT NULL +); + +CREATE TABLE gammu ( + Version INTEGER NOT NULL DEFAULT '0' +); + +INSERT INTO gammu (Version) VALUES (14); + +CREATE TABLE inbox ( + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + ReceivingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), + Text TEXT NOT NULL, + SenderNumber TEXT NOT NULL DEFAULT '', + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT NOT NULL, + SMSCNumber TEXT NOT NULL DEFAULT '', + Class INTEGER NOT NULL DEFAULT '-1', + TextDecoded TEXT NOT NULL DEFAULT '', + ID INTEGER PRIMARY KEY AUTOINCREMENT, + RecipientID TEXT NOT NULL, + Processed TEXT NOT NULL DEFAULT 'false', + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) +); + +CREATE TRIGGER update_inbox_time UPDATE ON inbox + BEGIN + UPDATE inbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID; + END; + +CREATE TABLE outbox ( + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), + SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), + SendBefore time NOT NULL DEFAULT '23:59:59', + SendAfter time NOT NULL DEFAULT '00:00:00', + Text TEXT, + DestinationNumber TEXT NOT NULL DEFAULT '', + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT, + Class INTEGER DEFAULT '-1', + TextDecoded TEXT NOT NULL DEFAULT '', + ID INTEGER PRIMARY KEY AUTOINCREMENT, + MultiPart TEXT NOT NULL DEFAULT 'false', + RelativeValidity INTEGER DEFAULT '-1', + SenderID TEXT, + SendingTimeOut NUMERIC NOT NULL DEFAULT (datetime('now')), + DeliveryReport TEXT DEFAULT 'default', + CreatorID TEXT NOT NULL, + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), + CHECK (DeliveryReport IN ('default','yes','no')) +); + +CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut); +CREATE INDEX outbox_sender ON outbox(SenderID); + +CREATE TRIGGER update_outbox_time UPDATE ON outbox + BEGIN + UPDATE outbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID; + END; + +CREATE TABLE outbox_multipart ( + Text TEXT, + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT, + Class INTEGER DEFAULT '-1', + TextDecoded TEXT DEFAULT NULL, + ID INTEGER, + SequencePosition INTEGER NOT NULL DEFAULT '1', + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), + PRIMARY KEY (ID, SequencePosition) +); + +CREATE TABLE pbk ( + ID INTEGER PRIMARY KEY AUTOINCREMENT, + GroupID INTEGER NOT NULL DEFAULT '-1', + Name TEXT NOT NULL, + Number TEXT NOT NULL +); + +CREATE TABLE pbk_groups ( + Name TEXT NOT NULL, + ID INTEGER PRIMARY KEY AUTOINCREMENT +); + +CREATE TABLE phones ( + ID TEXT NOT NULL, + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), + TimeOut NUMERIC NOT NULL DEFAULT (datetime('now')), + Send TEXT NOT NULL DEFAULT 'no', + Receive TEXT NOT NULL DEFAULT 'no', + IMEI TEXT PRIMARY KEY NOT NULL, + NetCode TEXT DEFAULT 'ERROR', + NetName TEXT DEFAULT 'ERROR', + Client TEXT NOT NULL, + Battery INTEGER NOT NULL DEFAULT -1, + Signal INTEGER NOT NULL DEFAULT -1, + Sent INTEGER NOT NULL DEFAULT 0, + Received INTEGER NOT NULL DEFAULT 0 +); + +CREATE TRIGGER update_phones_time UPDATE ON phones + BEGIN + UPDATE phones SET UpdatedInDB = datetime('now') WHERE IMEI = old.IMEI; + END; + +CREATE TABLE sentitems ( + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), + SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), + DeliveryDateTime NUMERIC NULL, + Text TEXT NOT NULL, + DestinationNumber TEXT NOT NULL DEFAULT '', + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT NOT NULL, + SMSCNumber TEXT NOT NULL DEFAULT '', + Class INTEGER NOT NULL DEFAULT '-1', + TextDecoded TEXT NOT NULL DEFAULT '', + ID INTEGER, + SenderID TEXT NOT NULL, + SequencePosition INTEGER NOT NULL DEFAULT '1', + Status TEXT NOT NULL DEFAULT 'SendingOK', + StatusError INTEGER NOT NULL DEFAULT '-1', + TPMR INTEGER NOT NULL DEFAULT '-1', + RelativeValidity INTEGER NOT NULL DEFAULT '-1', + CreatorID TEXT NOT NULL, + CHECK (Status IN + ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending', + 'DeliveryUnknown','Error')), + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) , + PRIMARY KEY (ID, SequencePosition) +); + +CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime); +CREATE INDEX sentitems_tpmr ON sentitems(TPMR); +CREATE INDEX sentitems_dest ON sentitems(DestinationNumber); +CREATE INDEX sentitems_sender ON sentitems(SenderID); + +CREATE TRIGGER update_sentitems_time UPDATE ON sentitems + BEGIN + UPDATE sentitems SET UpdatedInDB = datetime('now') WHERE ID = old.ID; + END; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/test/data/sqlite-15.sql new/python-gammu-2.5/test/data/sqlite-15.sql --- old/python-gammu-2.4/test/data/sqlite-15.sql 1970-01-01 01:00:00.000000000 +0100 +++ new/python-gammu-2.5/test/data/sqlite-15.sql 2016-01-19 14:39:32.000000000 +0100 @@ -0,0 +1,150 @@ +CREATE TABLE daemons ( + Start TEXT NOT NULL, + Info TEXT NOT NULL +); + +CREATE TABLE gammu ( + Version INTEGER NOT NULL DEFAULT '0' +); + +INSERT INTO gammu (Version) VALUES (15); + +CREATE TABLE inbox ( + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + ReceivingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), + Text TEXT NOT NULL, + SenderNumber TEXT NOT NULL DEFAULT '', + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT NOT NULL, + SMSCNumber TEXT NOT NULL DEFAULT '', + Class INTEGER NOT NULL DEFAULT '-1', + TextDecoded TEXT NOT NULL DEFAULT '', + ID INTEGER PRIMARY KEY AUTOINCREMENT, + RecipientID TEXT NOT NULL, + Processed TEXT NOT NULL DEFAULT 'false', + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) +); + +CREATE TRIGGER update_inbox_time UPDATE ON inbox + BEGIN + UPDATE inbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID; + END; + +CREATE TABLE outbox ( + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), + SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), + SendBefore time NOT NULL DEFAULT '23:59:59', + SendAfter time NOT NULL DEFAULT '00:00:00', + Text TEXT, + DestinationNumber TEXT NOT NULL DEFAULT '', + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT, + Class INTEGER DEFAULT '-1', + TextDecoded TEXT NOT NULL DEFAULT '', + ID INTEGER PRIMARY KEY AUTOINCREMENT, + MultiPart TEXT NOT NULL DEFAULT 'false', + RelativeValidity INTEGER DEFAULT '-1', + SenderID TEXT, + SendingTimeOut NUMERIC NOT NULL DEFAULT (datetime('now')), + DeliveryReport TEXT DEFAULT 'default', + CreatorID TEXT NOT NULL, + Retries INTEGER DEFAULT '0', + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), + CHECK (DeliveryReport IN ('default','yes','no')) +); + +CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut); +CREATE INDEX outbox_sender ON outbox(SenderID); + +CREATE TRIGGER update_outbox_time UPDATE ON outbox + BEGIN + UPDATE outbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID; + END; + +CREATE TABLE outbox_multipart ( + Text TEXT, + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT, + Class INTEGER DEFAULT '-1', + TextDecoded TEXT DEFAULT NULL, + ID INTEGER, + SequencePosition INTEGER NOT NULL DEFAULT '1', + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), + PRIMARY KEY (ID, SequencePosition) +); + +CREATE TABLE pbk ( + ID INTEGER PRIMARY KEY AUTOINCREMENT, + GroupID INTEGER NOT NULL DEFAULT '-1', + Name TEXT NOT NULL, + Number TEXT NOT NULL +); + +CREATE TABLE pbk_groups ( + Name TEXT NOT NULL, + ID INTEGER PRIMARY KEY AUTOINCREMENT +); + +CREATE TABLE phones ( + ID TEXT NOT NULL, + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), + TimeOut NUMERIC NOT NULL DEFAULT (datetime('now')), + Send TEXT NOT NULL DEFAULT 'no', + Receive TEXT NOT NULL DEFAULT 'no', + IMEI TEXT PRIMARY KEY NOT NULL, + NetCode TEXT DEFAULT 'ERROR', + NetName TEXT DEFAULT 'ERROR', + Client TEXT NOT NULL, + Battery INTEGER NOT NULL DEFAULT -1, + Signal INTEGER NOT NULL DEFAULT -1, + Sent INTEGER NOT NULL DEFAULT 0, + Received INTEGER NOT NULL DEFAULT 0 +); + +CREATE TRIGGER update_phones_time UPDATE ON phones + BEGIN + UPDATE phones SET UpdatedInDB = datetime('now') WHERE IMEI = old.IMEI; + END; + +CREATE TABLE sentitems ( + UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), + InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), + SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), + DeliveryDateTime NUMERIC NULL, + Text TEXT NOT NULL, + DestinationNumber TEXT NOT NULL DEFAULT '', + Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', + UDH TEXT NOT NULL, + SMSCNumber TEXT NOT NULL DEFAULT '', + Class INTEGER NOT NULL DEFAULT '-1', + TextDecoded TEXT NOT NULL DEFAULT '', + ID INTEGER, + SenderID TEXT NOT NULL, + SequencePosition INTEGER NOT NULL DEFAULT '1', + Status TEXT NOT NULL DEFAULT 'SendingOK', + StatusError INTEGER NOT NULL DEFAULT '-1', + TPMR INTEGER NOT NULL DEFAULT '-1', + RelativeValidity INTEGER NOT NULL DEFAULT '-1', + CreatorID TEXT NOT NULL, + CHECK (Status IN + ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending', + 'DeliveryUnknown','Error')), + CHECK (Coding IN + ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) , + PRIMARY KEY (ID, SequencePosition) +); + +CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime); +CREATE INDEX sentitems_tpmr ON sentitems(TPMR); +CREATE INDEX sentitems_dest ON sentitems(DestinationNumber); +CREATE INDEX sentitems_sender ON sentitems(SenderID); + +CREATE TRIGGER update_sentitems_time UPDATE ON sentitems + BEGIN + UPDATE sentitems SET UpdatedInDB = datetime('now') WHERE ID = old.ID; + END; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/test/data/sqlite.sql new/python-gammu-2.5/test/data/sqlite.sql --- old/python-gammu-2.4/test/data/sqlite.sql 2015-03-18 14:31:43.000000000 +0100 +++ new/python-gammu-2.5/test/data/sqlite.sql 1970-01-01 01:00:00.000000000 +0100 @@ -1,149 +0,0 @@ -CREATE TABLE daemons ( - Start TEXT NOT NULL, - Info TEXT NOT NULL -); - -CREATE TABLE gammu ( - Version INTEGER NOT NULL DEFAULT '0' -); - -INSERT INTO gammu (Version) VALUES (14); - -CREATE TABLE inbox ( - UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), - ReceivingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), - Text TEXT NOT NULL, - SenderNumber TEXT NOT NULL DEFAULT '', - Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', - UDH TEXT NOT NULL, - SMSCNumber TEXT NOT NULL DEFAULT '', - Class INTEGER NOT NULL DEFAULT '-1', - TextDecoded TEXT NOT NULL DEFAULT '', - ID INTEGER PRIMARY KEY AUTOINCREMENT, - RecipientID TEXT NOT NULL, - Processed TEXT NOT NULL DEFAULT 'false', - CHECK (Coding IN - ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) -); - -CREATE TRIGGER update_inbox_time UPDATE ON inbox - BEGIN - UPDATE inbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID; - END; - -CREATE TABLE outbox ( - UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), - InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), - SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), - SendBefore time NOT NULL DEFAULT '23:59:59', - SendAfter time NOT NULL DEFAULT '00:00:00', - Text TEXT, - DestinationNumber TEXT NOT NULL DEFAULT '', - Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', - UDH TEXT, - Class INTEGER DEFAULT '-1', - TextDecoded TEXT NOT NULL DEFAULT '', - ID INTEGER PRIMARY KEY AUTOINCREMENT, - MultiPart TEXT NOT NULL DEFAULT 'false', - RelativeValidity INTEGER DEFAULT '-1', - SenderID TEXT, - SendingTimeOut NUMERIC NOT NULL DEFAULT (datetime('now')), - DeliveryReport TEXT DEFAULT 'default', - CreatorID TEXT NOT NULL, - CHECK (Coding IN - ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), - CHECK (DeliveryReport IN ('default','yes','no')) -); - -CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut); -CREATE INDEX outbox_sender ON outbox(SenderID); - -CREATE TRIGGER update_outbox_time UPDATE ON outbox - BEGIN - UPDATE outbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID; - END; - -CREATE TABLE outbox_multipart ( - Text TEXT, - Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', - UDH TEXT, - Class INTEGER DEFAULT '-1', - TextDecoded TEXT DEFAULT NULL, - ID INTEGER, - SequencePosition INTEGER NOT NULL DEFAULT '1', - CHECK (Coding IN - ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), - PRIMARY KEY (ID, SequencePosition) -); - -CREATE TABLE pbk ( - ID INTEGER PRIMARY KEY AUTOINCREMENT, - GroupID INTEGER NOT NULL DEFAULT '-1', - Name TEXT NOT NULL, - Number TEXT NOT NULL -); - -CREATE TABLE pbk_groups ( - Name TEXT NOT NULL, - ID INTEGER PRIMARY KEY AUTOINCREMENT -); - -CREATE TABLE phones ( - ID TEXT NOT NULL, - UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), - InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), - TimeOut NUMERIC NOT NULL DEFAULT (datetime('now')), - Send TEXT NOT NULL DEFAULT 'no', - Receive TEXT NOT NULL DEFAULT 'no', - IMEI TEXT PRIMARY KEY NOT NULL, - NetCode TEXT DEFAULT 'ERROR', - NetName TEXT DEFAULT 'ERROR', - Client TEXT NOT NULL, - Battery INTEGER NOT NULL DEFAULT -1, - Signal INTEGER NOT NULL DEFAULT -1, - Sent INTEGER NOT NULL DEFAULT 0, - Received INTEGER NOT NULL DEFAULT 0 -); - -CREATE TRIGGER update_phones_time UPDATE ON phones - BEGIN - UPDATE phones SET UpdatedInDB = datetime('now') WHERE IMEI = old.IMEI; - END; - -CREATE TABLE sentitems ( - UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')), - InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')), - SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')), - DeliveryDateTime NUMERIC NULL, - Text TEXT NOT NULL, - DestinationNumber TEXT NOT NULL DEFAULT '', - Coding TEXT NOT NULL DEFAULT 'Default_No_Compression', - UDH TEXT NOT NULL, - SMSCNumber TEXT NOT NULL DEFAULT '', - Class INTEGER NOT NULL DEFAULT '-1', - TextDecoded TEXT NOT NULL DEFAULT '', - ID INTEGER, - SenderID TEXT NOT NULL, - SequencePosition INTEGER NOT NULL DEFAULT '1', - Status TEXT NOT NULL DEFAULT 'SendingOK', - StatusError INTEGER NOT NULL DEFAULT '-1', - TPMR INTEGER NOT NULL DEFAULT '-1', - RelativeValidity INTEGER NOT NULL DEFAULT '-1', - CreatorID TEXT NOT NULL, - CHECK (Status IN - ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending', - 'DeliveryUnknown','Error')), - CHECK (Coding IN - ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) , - PRIMARY KEY (ID, SequencePosition) -); - -CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime); -CREATE INDEX sentitems_tpmr ON sentitems(TPMR); -CREATE INDEX sentitems_dest ON sentitems(DestinationNumber); -CREATE INDEX sentitems_sender ON sentitems(SenderID); - -CREATE TRIGGER update_sentitems_time UPDATE ON sentitems - BEGIN - UPDATE sentitems SET UpdatedInDB = datetime('now') WHERE ID = old.ID; - END; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/test/test_dummy.py new/python-gammu-2.5/test/test_dummy.py --- old/python-gammu-2.4/test/test_dummy.py 2015-06-03 09:18:33.000000000 +0200 +++ new/python-gammu-2.5/test/test_dummy.py 2016-01-19 14:41:52.000000000 +0100 @@ -28,7 +28,7 @@ import os.path DUMMY_DIR = os.path.join(os.path.dirname(__file__), 'data', 'gammu-dummy') -TEST_FILE = os.path.join(os.path.dirname(__file__), 'data', 'sqlite.sql') +TEST_FILE = os.path.join(os.path.dirname(__file__), 'data', 'sqlite-14.sql') CONFIGURATION = ''' # Configuration for Gammu testsuite @@ -74,6 +74,8 @@ class BasicDummyTest(DummyTest): + _called = False + def test_model(self): state_machine = self.get_statemachine() self.assertEqual(state_machine.GetModel()[1], 'Dummy') @@ -227,15 +229,18 @@ ''' Callback on USSD data. ''' + self._called = True self.assertEqual(response, 'USSD') self.assertEqual(data['Text'], 'Reply for 1234') self.assertEqual(data['Status'], 'NoActionNeeded') def test_ussd(self): + self._called = False state_machine = self.get_statemachine() state_machine.SetIncomingCallback(self.ussd_callback) state_machine.SetIncomingUSSD() state_machine.DialService('1234') + self.assertTrue(self._called) def test_sendsms(self): state_machine = self.get_statemachine() @@ -254,7 +259,7 @@ 'from example python script. ' ) * 10 smsinfo = { - 'Class': 1, + 'Class': -1, 'Unicode': False, 'Entries': [ { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-gammu-2.4/test/test_smsd.py new/python-gammu-2.5/test/test_smsd.py --- old/python-gammu-2.4/test/test_smsd.py 2015-09-02 10:15:16.000000000 +0200 +++ new/python-gammu-2.5/test/test_smsd.py 2016-01-19 14:40:33.000000000 +0100 @@ -27,7 +27,7 @@ import time import sqlite3 -SQLITE_SCRIPT = os.path.join(os.path.dirname(__file__), 'data', 'sqlite.sql') + MESSAGE_1 = { 'Text': 'python-gammu testing message', 'SMSC': {'Location': 1}, @@ -40,13 +40,34 @@ } +def get_script(): + """Returns SQL script to create database + + It returns correct script matching used Gammu version. + """ + version = tuple( + [int(x) for x in gammu.Version()[0].split('.')] + ) + + if version < (1, 36, 7): + dbver = 14 + else: + dbver = 15 + + return os.path.join( + os.path.dirname(__file__), + 'data', + 'sqlite-{0}.sql'.format(dbver) + ) + + class SMSDDummyTest(DummyTest): def setUp(self): super(SMSDDummyTest, self).setUp() database = sqlite3.connect( os.path.join(self.test_dir, 'smsd.db') ) - with open(SQLITE_SCRIPT, 'r') as handle: + with open(get_script(), 'r') as handle: database.executescript(handle.read()) def get_smsd(self):
participants (1)
-
root@hilbert.suse.de