pade icon indicating copy to clipboard operation
pade copied to clipboard

Error with start-web-interface

Open ShrutiKaha opened this issue 5 years ago • 1 comments

(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'

ShrutiKaha avatar Jan 08 '21 07:01 ShrutiKaha

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.

singalhimanshu avatar Feb 18 '21 07:02 singalhimanshu