glidernet / ogn-python

A gateway with built-in database for the Open Glider Network (OGN)
http://glidernet.org
GNU Affero General Public License v3.0
17 stars 4 forks source link

flydenity_parser.ARParser doesn't exist #157

Open matburnham opened 2 years ago

matburnham commented 2 years ago

importddb relies on flydenity_parser.ARParser which doesn't seem to exist (any more?):

(ogn-python) mat@devbox:~/dev/ogn-python$ flask database import_ddb
Import registered devices fom the DDB...
Traceback (most recent call last):
  File "/home/mat/.virtualenvs/ogn-python/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/flask/cli.py", line 990, in main
    cli.main(args=sys.argv[1:])
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/flask/cli.py", line 596, in main
    return super().main(*args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/flask/cli.py", line 440, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/mat/dev/ogn-python/app/commands/database.py", line 90, in import_ddb
    counter = merge_sender_infos(sender_info_dicts)
  File "/home/mat/dev/ogn-python/app/collect/database.py", line 101, in merge_sender_infos
    parser = flydenity_parser.ARParser()
AttributeError: module 'flydenity.parser' has no attribute 'ARParser'

Fix appears like it might be to simply replace ARParser with Parser, but then it gets into trouble with parsing the (string) output from the parser:

(ogn-python) mat@devbox:~/dev/ogn-python$ flask database import_ddb
Import registered devices from the DDB...
Traceback (most recent call last):
  File "/home/mat/.virtualenvs/ogn-python/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/flask/cli.py", line 990, in main
    cli.main(args=sys.argv[1:])
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/flask/cli.py", line 596, in main
    return super().main(*args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/flask/cli.py", line 440, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/home/mat/.virtualenvs/ogn-python/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/mat/dev/ogn-python/app/commands/database.py", line 90, in import_ddb
    counter = merge_sender_infos(sender_info_dicts)
  File "/home/mat/dev/ogn-python/app/collect/database.py", line 109, in merge_sender_infos
    sender_info.country = countries[dataset['iso2']]
TypeError: string indices must be integers

I could go further down the rabbit hole of fixing it, but wonder if I've mis-fixed my ARParser issue.

matburnham commented 2 years ago

Looks like sbrodehl@3a3e28a5c0b70f3208b85a67ea08d98aa947c91d fixes this.