Skip to content

Commit 9aeaff7

Browse files
committed
Hologram Python SDK v0.5.25 release
1 parent 0535b44 commit 9aeaff7

File tree

9 files changed

+35
-17
lines changed

9 files changed

+35
-17
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2017-08-31 Hologram <[email protected]>
2+
* Updated install script to include libpython2.7-dev as a require dependency.
3+
* added better error messages for unsupported operating systems/platforms.
4+
15
2017-08-08 Hologram <[email protected]>
26
* Fixed SMS timestamp issue. (wrong offset value)
37

Hologram/Cloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from Network import NetworkManager
1515
from Authentication import *
1616

17-
__version__ = '0.5.24'
17+
__version__ = '0.5.25'
1818

1919
class Cloud(object):
2020

Hologram/CustomCloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
MAX_QUEUED_CONNECTIONS = 5
2020
RECEIVE_TIMEOUT = 5
2121
SEND_TIMEOUT = 5
22-
MIN_PERIODIC_INTERVAL = 10
22+
MIN_PERIODIC_INTERVAL = 30
2323

2424
class CustomCloud(Cloud):
2525

install.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euo pipefail
44
# This script will install the Hologram SDK and the necessary software dependencies
55
# for it to work.
66

7-
required_programs=('python' 'pip' 'ps' 'kill')
7+
required_programs=('python' 'pip' 'ps' 'kill' 'libpython2.7-dev')
88
OS=''
99

1010
# Check OS.
@@ -30,6 +30,12 @@ elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
3030
OS='WINDOWS'
3131
fi
3232

33+
# Error out on unsupported OS.
34+
if [ "$OS" == 'DARWIN' ] || [ "$OS" == 'WINDOWS' ]; then
35+
echo "$OS is not supported right now"
36+
exit 1
37+
fi
38+
3339
function pause() {
3440
read -p "$*"
3541
}
@@ -45,7 +51,7 @@ function install_software() {
4551
fi
4652
}
4753

48-
# EFECTS: Returns true if the specified program is installed, false otherwise.
54+
# EFFECTS: Returns true if the specified program is installed, false otherwise.
4955
function check_if_installed() {
5056
if command -v "$*" >/dev/null 2>&1; then
5157
return 0
@@ -54,6 +60,19 @@ function check_if_installed() {
5460
fi
5561
}
5662

63+
function update_repository() {
64+
if [ "$OS" == 'LINUX' ]; then
65+
sudo apt-get update
66+
elif [ "$OS" == 'DARWIN' ]; then
67+
brew update
68+
echo 'TODO: macOS should go here'
69+
elif [ "$OS" == 'WINDOWS' ]; then
70+
echo 'TODO: windows should go here'
71+
fi
72+
}
73+
74+
update_repository
75+
5776
# Iterate over all programs to see if they are installed
5877
# Installs them if necessary
5978
for program in ${required_programs[*]}
@@ -76,7 +95,5 @@ do
7695
fi
7796
done
7897

79-
sudo apt-get install libpython2.7-dev
80-
8198
# Install SDK itself.
8299
sudo pip install hologram-python

scripts/hologram_heartbeat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# LICENSE: Distributed under the terms of the MIT License
1212

1313
DEFAULT_TIMEOUT = 5
14-
DEFAULT_REPEAT_PERIOD = 10
14+
DEFAULT_REPEAT_PERIOD = 30
1515

1616
# Hologram heartbeat is basically an alias for send cloud with a specified timeout.
1717
from scripts.hologram_send import run_hologram_send

scripts/hologram_receive.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ def parse_hologram_receive_args(parser):
3535
help='The modem type. Choose between nova, ms2131 and e303.')
3636
parser.add_argument('-v', '--verbose', action='store_true', required=False)
3737
parser.add_argument('-t', '--timeout', type=int, nargs='?', default=-1,
38-
help='The number of seconds before the socket is closed. \
39-
Default is to block indefinitely.')
38+
help='The number of seconds before the socket is closed. Default is to block indefinitely.')
4039
parse_data_args(parser)
4140
parse_sms_args(parser)
4241

scripts/hologram_send.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def parse_hologram_send_args(parser):
3333
parser.add_argument('-v', '--verbose', action='store_true', required=False)
3434
parser.add_argument('--host', required=False, help=argparse.SUPPRESS)
3535
parser.add_argument('-p', '--port', required=False, help=argparse.SUPPRESS)
36-
parser.add_argument('--iccid', nargs='?', help='Hologram device id')
37-
parser.add_argument('--imsi', nargs='?', help='Hologram private key')
36+
parser.add_argument('--iccid', nargs='?', help=argparse.SUPPRESS)
37+
parser.add_argument('--imsi', nargs='?', help=argparse.SUPPRESS)
3838
parser.add_argument('--authtype', default='totp', nargs='?',
3939
help='The authentication type used if HologramCloud is in use')
4040

@@ -51,13 +51,11 @@ def parse_cloud_args(parser):
5151
parser.add_argument('--cloud', action='store_true', help='Message that will be sent to the cloud')
5252

5353
parser.add_argument('--duration', type=int, nargs='?', default=-1,
54-
help='The number of seconds before periodic message ends. \
55-
Default is to block indefinitely.')
54+
help='The number of seconds before periodic message ends. Default is to block indefinitely.')
5655
parser.add_argument('--repeat', type=int, default=0, nargs='?',
5756
help='Time period for each message send')
5857
parser.add_argument('--timeout', type=int, default=DEFAULT_TIMEOUT, nargs='?',
59-
help='The period in seconds before the socket closes \
60-
if it doesn\'t receive a response')
58+
help='The period in seconds before the socket closes if it doesn\'t receive a response')
6159
parser.add_argument('-t', '--topic', nargs = '*',
6260
help='Topics for the message (optional)')
6361

tests/MessageMode/test_Cloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ def test_invalid_send_sms(self):
4040
def test_sdk_version(self):
4141
cloud = Cloud(None, send_host = '127.0.0.1', send_port = 9999)
4242

43-
assert cloud.version == '0.5.24'
43+
assert cloud.version == '0.5.25'

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.24
1+
0.5.25

0 commit comments

Comments
 (0)