Skip to content
This repository has been archived by the owner on Sep 26, 2018. It is now read-only.

Commit

Permalink
make sms_utilities py3 friendly [part 2 of more]
Browse files Browse the repository at this point in the history
Summary:
python3 happiness and a version bump

Depends on D4799715

Differential Revision: D4800063

fbshipit-source-id: 588f78d43207eccd81986b6e91b5b7af16ebc843
  • Loading branch information
kkroo authored and facebook-github-bot committed Apr 14, 2017
1 parent 853db27 commit b08541b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion sms_utilities/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
smspdu==1.0
smspdu==1.1
2 changes: 1 addition & 1 deletion sms_utilities/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
readme = f.read()

github_url = 'https://github.com/facebookincubator/CommunityCellularManager/sms_utilities'
version = '0.0.3'
version = '0.0.4'
download_url = '%s/%s' % (github_url, version)

setup(
Expand Down
4 changes: 2 additions & 2 deletions sms_utilities/sms_utilities/SMS_Deliver.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from smspdu import SMS_DELIVER

import SMS_Helper
from . import SMS_Helper


def gen_tpdu(ref, to, fromm, text, empty):
Expand Down Expand Up @@ -58,4 +58,4 @@ def gen_msg(to, fromm, text, empty=False):
if len(sys.argv) > 2:
to = sys.argv[1]
msg = sys.argv[2]
print gen_msg(to, fromm, msg)
print(gen_msg(to, fromm, msg))
4 changes: 2 additions & 2 deletions sms_utilities/sms_utilities/SMS_Helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def encode_num(num):


def clean(s):
if isinstance(s, basestring):
if isinstance(s, str):
return filter(lambda x: x in string.printable, s).strip()
elif isinstance(s, int):
return "%X" % s
Expand All @@ -57,4 +57,4 @@ def smspdu_charstring_to_hex(string):
to = "1234567"
if len(sys.argv) > 1:
to = sys.argv[1]
print encode_num(to)
print(encode_num(to))
6 changes: 3 additions & 3 deletions sms_utilities/sms_utilities/SMS_Parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

from smspdu import SMS_SUBMIT

from rpdu import RPDU
from SMS_Helper import clean, smspdu_charstring_to_hex
from .rpdu import RPDU
from .SMS_Helper import clean, smspdu_charstring_to_hex


def parse(rp_message):
Expand All @@ -40,4 +40,4 @@ def parse(rp_message):
h = "001000038100000e05df04810011000005cbb7fb0c02"
if len(sys.argv) > 1:
h = sys.argv[1]
print parse(h)
print(parse(h))
4 changes: 2 additions & 2 deletions sms_utilities/sms_utilities/SMS_Submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from smspdu import SMS_SUBMIT

import SMS_Helper
from . import SMS_Helper


def gen_tpdu(ref, to, text, empty):
Expand Down Expand Up @@ -54,4 +54,4 @@ def gen_msg(to, text, empty=False):
if len(sys.argv) > 2:
to = sys.argv[1]
msg = sys.argv[2]
print gen_msg(to, msg)
print(gen_msg(to, msg))
2 changes: 1 addition & 1 deletion sms_utilities/sms_utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

"""Core modules."""

import rpdu, SMS_Deliver, SMS_Helper, SMS_Parse, SMS_Submit
from . import rpdu, SMS_Deliver, SMS_Helper, SMS_Parse, SMS_Submit

0 comments on commit b08541b

Please sign in to comment.