Rename clickquiry to cliq and remove util package
This commit is contained in:
parent
1bc51d2de5
commit
54e117c9e7
2
maubot/cli/cliq/__init__.py
Normal file
2
maubot/cli/cliq/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
from .cliq import command, option
|
||||
from .validators import SPDXValidator, VersionValidator, PathValidator
|
@ -16,7 +16,7 @@
|
||||
import click
|
||||
|
||||
from ..base import app
|
||||
from ..util.validators import PathValidator
|
||||
from ..cliq.validators import PathValidator
|
||||
|
||||
|
||||
@app.command(short_help="Build a maubot plugin",
|
||||
|
@ -19,8 +19,8 @@ import os
|
||||
from packaging.version import Version
|
||||
from jinja2 import Template
|
||||
|
||||
from ..util.validators import SPDXValidator, VersionValidator
|
||||
from ..util import clickquiry
|
||||
from .. import cliq
|
||||
from ..cliq import SPDXValidator, VersionValidator
|
||||
|
||||
loaded: bool = False
|
||||
meta_template: Template
|
||||
@ -38,17 +38,17 @@ def load_templates():
|
||||
loaded = True
|
||||
|
||||
|
||||
@clickquiry.command(help="Initialize a new maubot plugin")
|
||||
@clickquiry.option("-n", "--name", help="The name of the project", required=True,
|
||||
default=os.path.basename(os.getcwd()))
|
||||
@clickquiry.option("-i", "--id", message="ID", required=True,
|
||||
help="The maubot plugin ID (Java package name format)")
|
||||
@clickquiry.option("-v", "--version", help="Initial version for project (PEP-440 format)",
|
||||
default="0.1.0", validator=VersionValidator, required=True)
|
||||
@clickquiry.option("-l", "--license", validator=SPDXValidator, default="AGPL-3.0-or-later",
|
||||
help="The license for the project (SPDX identifier)", required=False)
|
||||
@clickquiry.option("-c", "--config", message="Should the plugin include a config?",
|
||||
help="Include a config in the plugin stub", default=False, is_flag=True)
|
||||
@cliq.command(help="Initialize a new maubot plugin")
|
||||
@cliq.option("-n", "--name", help="The name of the project", required=True,
|
||||
default=os.path.basename(os.getcwd()))
|
||||
@cliq.option("-i", "--id", message="ID", required=True,
|
||||
help="The maubot plugin ID (Java package name format)")
|
||||
@cliq.option("-v", "--version", help="Initial version for project (PEP-440 format)",
|
||||
default="0.1.0", validator=VersionValidator, required=True)
|
||||
@cliq.option("-l", "--license", validator=SPDXValidator, default="AGPL-3.0-or-later",
|
||||
help="The license for the project (SPDX identifier)", required=False)
|
||||
@cliq.option("-c", "--config", message="Should the plugin include a config?",
|
||||
help="Include a config in the plugin stub", default=False, is_flag=True)
|
||||
def init(name: str, id: str, version: Version, license: str, config: bool) -> None:
|
||||
load_templates()
|
||||
main_class = name[0].upper() + name[1:]
|
||||
|
@ -21,13 +21,13 @@ import os
|
||||
from colorama import Fore, Style
|
||||
|
||||
from ..config import save_config, config
|
||||
from ..util import clickquiry
|
||||
from ..cliq import cliq
|
||||
|
||||
|
||||
@clickquiry.command(help="Log in to a Maubot instance")
|
||||
@clickquiry.option("-u", "--username", help="The username of your account", default=os.environ.get("USER", None), required=True)
|
||||
@clickquiry.option("-p", "--password", help="The password to your account", inq_type="password", required=True)
|
||||
@clickquiry.option("-s", "--server", help="The server to log in to", default="http://localhost:29316", required=True)
|
||||
@cliq.command(help="Log in to a Maubot instance")
|
||||
@cliq.option("-u", "--username", help="The username of your account", default=os.environ.get("USER", None), required=True)
|
||||
@cliq.option("-p", "--password", help="The password to your account", inq_type="password", required=True)
|
||||
@cliq.option("-s", "--server", help="The server to log in to", default="http://localhost:29316", required=True)
|
||||
def login(server, username, password) -> None:
|
||||
data = {
|
||||
"username": username,
|
||||
|
Loading…
Reference in New Issue
Block a user