Skip to content

Commit 69710f9

Browse files
committed
Hologram Python SDK v0.8.1 release
1 parent c1af498 commit 69710f9

File tree

9 files changed

+18
-12
lines changed

9 files changed

+18
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# What's New in Hologram Python SDK
22

3+
## v0.8.1
4+
2018-09-12 Hologram <[email protected]>
5+
* Fix issues with PPP (`hologram network connect`) on Nova R410
6+
* Fix bugs with activating SIM cards via `hologram activate`
7+
command and stop echoing out passwords
8+
39
## v0.8.0
410

511
2018-07-19 Hologram <[email protected]>

Hologram/Api/Api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def activateSIM(self, sim='', plan=None, zone=1, preview=False):
4343

4444
response = requests.post(endpoint, **args)
4545
if response.status_code != requests.codes.ok:
46-
response.raise_for_status()
46+
return (False, response.text)
4747

4848
response = response.json()
4949
if response['success'] == False:

Hologram/Cloud.py

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

16-
__version__ = '0.8.0'
16+
__version__ = '0.8.1'
1717

1818
class Cloud(object):
1919

Hologram/Network/Modem/NovaM.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def __init__(self, device_name=None, baud_rate='9600',
2727
chatscript_file=chatscript_file, event=event)
2828
self._at_sockets_available = True
2929
modem_id = self.modem_id
30+
self.baud_rate = '115200'
3031
if("R404" in modem_id):
3132
self.is_r410 = False
3233
else:

scripts/hologram_activate.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# LICENSE: Distributed under the terms of the MIT License
1212

1313
import copy
14+
import getpass
1415
import sys
1516
import time
1617

@@ -95,7 +96,7 @@ def run_hologram_activate(args):
9596

9697

9798
def confirm_activation(sim, plan_name, selected_plan, selected_zone, total_cost):
98-
response = raw_input("Activate SIM #%s on %s Zone %d for $%d (y/N)? " % (sim, plan_name, selected_zone, total_cost))
99+
response = raw_input("Activate SIM #%s on %s Zone %s for $%.2f (y/N)? " % (sim, plan_name, str(selected_zone), total_cost))
99100
return response == 'y'
100101

101102
# EFFECTS: Populate valid and available plans and returns a plan -> zones dictionary.
@@ -104,7 +105,7 @@ def populate_valid_plans(plans):
104105

105106
for plan in plans:
106107
if is_available_developer_plan(plan) or is_pay_as_you_go_plan(plan):
107-
planIdToZonesDict[plan['id']] = copy.deepcopy(plan['zones'])
108+
planIdToZonesDict[plan['id']] = copy.deepcopy(plan['tiers']['BASE']['zones'])
108109
return planIdToZonesDict
109110

110111
def prompt_for_plan(plans, planIdToZonesDict):
@@ -146,7 +147,7 @@ def prompt_for_zone(zones):
146147
zoneids = []
147148

148149
for zoneid, zone_details in zones.iteritems():
149-
zoneids.append(int(zoneid))
150+
zoneids.append(zoneid)
150151
print_zone_description(zoneid, zone_details)
151152

152153
# There's only one available zone, so we can just select that without asking
@@ -157,10 +158,6 @@ def prompt_for_zone(zones):
157158
while True:
158159
try:
159160
zone = raw_input('Choose the zone for this device: ')
160-
if not zone.isdigit():
161-
print('Error: Invalid zone')
162-
continue
163-
zone = int(zone)
164161
if zone not in zoneids:
165162
print('Error: Invalid zone')
166163
continue
@@ -200,7 +197,7 @@ def prompt_for_username_and_password():
200197

201198
try:
202199
username = raw_input("Please enter your Hologram username: ")
203-
password = raw_input("Please enter your Hologram password: ")
200+
password = getpass.getpass("Please enter your Hologram password: ")
204201
except KeyboardInterrupt as e:
205202
sys.exit(1)
206203

scripts/hologram_modem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def run_modem_connect(args):
4242
cloud = CustomCloud(None, network='cellular')
4343
cloud.network.disable_at_sockets_mode()
4444
cloud.network.connect()
45+
print 'PPP session started'
4546

4647
def run_modem_disconnect(args):
4748
print 'Checking for existing PPP sessions'

scripts/hologram_network.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def run_network_connect(args):
2323
cloud = CustomCloud(None, network='cellular')
2424
cloud.network.disable_at_sockets_mode()
2525
cloud.network.connect()
26+
print 'PPP session started'
2627

2728
def run_network_disconnect(args):
2829
print 'Checking for existing PPP sessions'

tests/MessageMode/test_Cloud.py

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

51-
assert cloud.version == '0.8.0'
51+
assert cloud.version == '0.8.1'

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.0
1+
0.8.1

0 commit comments

Comments
 (0)