Skip to content

Commit

Permalink
Merge pull request #25 from auscompgeek/fix-extra-leading-slash
Browse files Browse the repository at this point in the history
Fix keys set from JS gaining an extra leading /
  • Loading branch information
virtuald committed Feb 21, 2018
2 parents f8912e0 + 42bef0f commit 487c6f8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pynetworktables2js/nt_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ def __init__(self, update_callback):
formatted as strings.
"""
self.update_callback = update_callback
self.nt = NetworkTables.getGlobalTable()
NetworkTables.addGlobalListener(self._nt_on_change, immediateNotify=True)
NetworkTables.addConnectionListener(self._nt_connected, immediateNotify=True)

def process_update(self, update):
"""Process an incoming update from a remote NetworkTables"""
data = json.loads(update)
self.nt.putValue(data['k'], data['v'])
NetworkTables.putValue(data['k'], data['v'])

def _send_update(self, data):
"""Send a NetworkTables update via the stored send_update callback"""
Expand Down

0 comments on commit 487c6f8

Please sign in to comment.