esme: import smpplib module on first use

Change-Id: Icc92937fdada9210f788805dbc42b80014e345e8
This commit is contained in:
Pau Espin 2020-05-05 17:03:54 +02:00
parent cc89cd0c5f
commit 45149393e7
1 changed files with 7 additions and 9 deletions

View File

@ -17,12 +17,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import smpplib.gsm
import smpplib.client
import smpplib.command
import smpplib.consts
import smpplib.exceptions
from ..core import log
from ..core.event_loop import MainLoop
@ -35,9 +29,6 @@ MAX_PASSWD_LEN = 16
class Esme(log.Origin):
MSGMODE_TRANSACTION = smpplib.consts.SMPP_MSGMODE_FORWARD
MSGMODE_STOREFORWARD = smpplib.consts.SMPP_MSGMODE_STOREFORWARD
def __init__(self, msisdn):
self.msisdn = msisdn
# Get last characters of msisdn to stay inside MAX_SYS_ID_LEN. Similar to modulus operator.
@ -51,6 +42,13 @@ class Esme(log.Origin):
self.listening = False
self.references_pending_receipt = []
self.next_user_message_reference = 1
import smpplib.gsm
import smpplib.client
import smpplib.command
import smpplib.consts
import smpplib.exceptions
self.MSGMODE_TRANSACTION = smpplib.consts.SMPP_MSGMODE_FORWARD
self.MSGMODE_STOREFORWARD = smpplib.consts.SMPP_MSGMODE_STOREFORWARD
def __del__(self):
self.cleanup()