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

Error with start-web-interface #67

Open
ShrutiKaha opened this issue Jan 8, 2021 · 1 comment
Open

Error with start-web-interface #67

ShrutiKaha opened this issue Jan 8, 2021 · 1 comment

Comments

@ShrutiKaha
Copy link

(base) C:\Users\shrut>pade start-web-interface
[...] Creating Pade tables in selected data base.
[ok_] Tables created in selected data base
[...] Starting Flask web interface.
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\programdata\anaconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\Scripts\pade.exe_main
.py", line 7, in
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 829, in call
return self.main(*args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\pade\cli\pade_cmd.py", line 289, in start_web_interface
p = FlaskServerProcess()
TypeError: init() missing 1 required positional argument: 'secure'

@singalhimanshu
Copy link
Contributor

I don't think this api is complete yet. One way to make it work is by passing --secure flag but for that the following changes has to be made -

@cmd.command()
@click.option('--secure', is_flag=True)
def start_web_interface(secure):
    create_tables()
    click.echo(click.style('[...] Starting Flask web interface.', fg='red'))

    p = FlaskServerProcess(secure)
    p.daemon = True
    p.start()

    while True:
        time.sleep(2.0)

        if interrupted:
            click.echo(click.style('\nStoping PADE...', fg='red'))
            p.kill()
            break

    click.echo(click.style('[ok_] Flask web interface stopped', fg='green'))

I am not completely sure if this is the intented solution. Please let me know I can create a pull request to fix this issue.

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

2 participants