Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flydenity_parser.ARParser doesn't exist #157

Open
matburnham opened this issue Jul 3, 2022 · 1 comment
Open

flydenity_parser.ARParser doesn't exist #157

matburnham opened this issue Jul 3, 2022 · 1 comment

Comments

@matburnham
Copy link

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
Copy link
Author

Looks like sbrodehl/ogn-python@3a3e28a fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant