matehackers / matebot

Bot do Matehackers
https://denise.matehackers.org/tercasemfim
GNU General Public License v3.0
9 stars 6 forks source link

Feedback de desenvolvedor #54

Closed iuriguilherme closed 4 years ago

iuriguilherme commented 4 years ago

Arquivo de configuração não encontrado. Exceção: 'FLASK_ENV'

a existência do arquivo .env nunca é testada em start.py

iuriguilherme commented 4 years ago

ou então o problema é usar FLASK_ENV from os.environment em ptb_matebot/init.py:

Traceback (most recent call last):
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/flask/cli.py", line 967, in main
    cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/flask/cli.py", line 848, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/flask/cli.py", line 305, in __init__
    self._load_unlocked()
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/flask/cli.py", line 330, in _load_unlocked
    self._app = rv = self.loader()
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/flask/cli.py", line 392, in load_app
    app = locate_app(self, import_name, None, raise_if_not_found=False)
  File "/home/iuri/.local/share/virtualenvs/matebot-OupDHXVR/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app
    __import__(module_name)
  File "/home/iuri/git/matehackers/matebot/app.py", line 2, in <module>
    from matebot.ptb_matebot import app
  File "/home/iuri/git/matehackers/matebot/matebot/ptb_matebot/__init__.py", line 40, in <module>
    ''.join([os.environ['FLASK_ENV'], 'Config']),
  File "/usr/lib/python3.7/os.py", line 678, in __getitem__
    raise KeyError(key) from None
KeyError: 'FLASK_ENV'
iuriguilherme commented 4 years ago

Nem importa mais o PTB e TP em 9a1b6239abd4d5b7805dbf71c32248ea4a85dec1