Skip to content

Commit

Permalink
cli fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jessekrubin committed Nov 2, 2023
1 parent d67a994 commit 512120b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions python/utiles/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,19 @@ def feature_gen() -> Iterable[Dict[str, Any]]:
else:

def feature_gen() -> Iterable[Dict[str, Any]]:
yield json.loads(first_line)
def _cleanline(line: str):
# strip newlines
line = line.strip()
# strip spaces
line = line.strip()
if line.startswith('"'):
line = line.strip('"')
return line
yield json.loads(_cleanline(first_line))
for line in src:
yield json.loads(line)
yield json.loads(
_cleanline(line)
)

for obj in feature_gen():
if isinstance(obj, list):
Expand Down

0 comments on commit 512120b

Please sign in to comment.