Skip to content

Commit 5b9a247

Browse files
authored
Merge pull request #422 from NASA-AMMOS/minor-fixes
Minor fixes to issues found in master
2 parents 347af0f + 0c802ff commit 5b9a247

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ait/core/cmd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,13 @@ def encode(self, value):
119119
"""Encodes the given value according to this AIT Argument
120120
Definition.
121121
"""
122+
if not self.type:
123+
return bytearray()
124+
122125
if type(value) == str and self.enum and value in self.enum:
123126
value = self.enum[value]
124-
return self.type.encode(value) if self.type else bytearray()
127+
return self.type.encode(*value) if type(value) in [tuple, list] else self.type.encode(value)
128+
125129

126130
def slice(self, offset=0):
127131
"""Returns a Python slice object (e.g. for array indexing) indicating

ait/core/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ def insert(self, packet, time=None, **kwargs):
708708
if time \
709709
else (sqlite3.Binary(packet._data))
710710

711-
self._conn.execute(sql, (sqlite3.Binary(packet._data), time))
711+
self._conn.execute(sql, values)
712712
self._conn.commit()
713713

714714
def _query(self, query, **kwargs):

0 commit comments

Comments
 (0)