websoft9/cli/stackhub.py

62 lines
1.4 KiB
Python
Raw Normal View History

2021-09-26 07:22:38 +00:00
#!/usr/bin/env python3
2021-09-27 09:32:10 +00:00
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
2021-09-23 10:06:29 +00:00
import os, io, sys, platform, shutil, urllib3, json, time, subprocess
2021-09-26 09:57:34 +00:00
import model, controller
2021-09-23 10:06:29 +00:00
import typer
app = typer.Typer()
@app.command()
2021-10-18 11:07:41 +00:00
def ls(status: Optional[str] = 'all'):
'''list all the project have installed'''
print = controller.Print(status)
print.lsProject()
2021-09-26 15:05:59 +00:00
@app.command()
2021-09-27 09:32:10 +00:00
def create(app_name: str, project_name: Optional[str] = None):
'''create one application'''
create = controller.Create(app_name, project_name)
create.downRepo()
2021-09-28 10:34:18 +00:00
create.setEnv()
2021-10-10 15:54:15 +00:00
create.upRepo()
2021-09-28 10:34:18 +00:00
create.printResult()
@app.command()
def start(app_name: str, project_name: Optional[str] = None):
'''start one application'''
pass
2021-09-26 07:22:38 +00:00
@app.command()
def update(name: str):
'''update the local lists cache'''
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
2021-09-26 07:22:38 +00:00
@app.command()
def upgrade(name: str):
'''upgrade one application'''
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
2021-09-26 07:22:38 +00:00
@app.command()
def search(name: str):
'''Search application you want to install'''
2021-09-23 10:06:29 +00:00
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
2021-09-26 07:22:38 +00:00
@app.command()
def show(name: str):
'''show the detail of application'''
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
@app.command()
def package(name: str):
'''package one application for no network environment'''
typer.echo(f"Hello {name}")
2021-09-23 10:06:29 +00:00
if __name__ == "__main__":
2021-09-26 07:22:38 +00:00
app()