This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new 36e2ac6 frontend: adds missing help for some commands
36e2ac6 is described below
commit 36e2ac6eb5645768ec24b58829d2349c065ae656
Author: Tomas Hrnciar <thrnciar(a)redhat.com>
AuthorDate: Wed Nov 13 09:11:52 2019 +0100
frontend: adds missing help for some commands
Fixes: #1100
Merges: #1106
---
frontend/coprs_frontend/commands/alter_user.py | 3 +++
frontend/coprs_frontend/commands/create_db.py | 6 +++---
frontend/coprs_frontend/commands/create_sqlite_file.py | 9 ++++-----
frontend/coprs_frontend/commands/drop_db.py | 7 +++----
frontend/coprs_frontend/commands/dump_user.py | 3 +++
frontend/coprs_frontend/commands/get_admins.py | 3 +++
frontend/coprs_frontend/commands/rawhide_to_release.py | 3 +++
frontend/coprs_frontend/commands/test.py | 3 +++
8 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/frontend/coprs_frontend/commands/alter_user.py
b/frontend/coprs_frontend/commands/alter_user.py
index 870d498..da4e404 100644
--- a/frontend/coprs_frontend/commands/alter_user.py
+++ b/frontend/coprs_frontend/commands/alter_user.py
@@ -8,6 +8,9 @@ from coprs import models
@click.option('--proven/--no-proven', default=False)
@click.option('--proxy/--no-proxy', default=False)
def alter_user(name, admin, proven, proxy):
+ """
+ Alter user data
+ """
user = models.User.query.filter(
models.User.username == name).first()
if not user:
diff --git a/frontend/coprs_frontend/commands/create_db.py
b/frontend/coprs_frontend/commands/create_db.py
index 36c101e..f0f929c 100644
--- a/frontend/coprs_frontend/commands/create_db.py
+++ b/frontend/coprs_frontend/commands/create_db.py
@@ -4,9 +4,6 @@ from commands.create_sqlite_file import create_sqlite_file_function
import click
-"""
-Create the DB schema
-"""
@click.command()
@click.option(
"--alembic", "-f", "alembic_ini",
@@ -14,6 +11,9 @@ Create the DB schema
required=True
)
def create_db(alembic_ini):
+ """
+ Create the DB schema
+ """
create_sqlite_file_function()
db.create_all()
# load the Alembic configuration and generate the
diff --git a/frontend/coprs_frontend/commands/create_sqlite_file.py
b/frontend/coprs_frontend/commands/create_sqlite_file.py
index 6485c0b..1df0887 100644
--- a/frontend/coprs_frontend/commands/create_sqlite_file.py
+++ b/frontend/coprs_frontend/commands/create_sqlite_file.py
@@ -3,11 +3,6 @@ import flask
import click
-"""
-Create the sqlite DB file (not the tables).
-Used for alembic, "create-db" does this automatically.
-"""
-
def create_sqlite_file_function():
if
flask.current_app.config["SQLALCHEMY_DATABASE_URI"].startswith("sqlite"):
# strip sqlite:///
@@ -18,4 +13,8 @@ def create_sqlite_file_function():
@click.command()
def create_sqlite_file():
+ """
+ Create the sqlite DB file (not the tables).
+ Used for alembic, "create-db" does this automatically.
+ """
return create_sqlite_file()
diff --git a/frontend/coprs_frontend/commands/drop_db.py
b/frontend/coprs_frontend/commands/drop_db.py
index 62b82ac..a54a660 100644
--- a/frontend/coprs_frontend/commands/drop_db.py
+++ b/frontend/coprs_frontend/commands/drop_db.py
@@ -2,10 +2,9 @@ from coprs import db
import click
-"""
-Delete DB
-"""
-
@click.command()
def drop_db():
+ """
+ Delete DB
+ """
db.drop_all()
diff --git a/frontend/coprs_frontend/commands/dump_user.py
b/frontend/coprs_frontend/commands/dump_user.py
index dc8e2bd..167549a 100644
--- a/frontend/coprs_frontend/commands/dump_user.py
+++ b/frontend/coprs_frontend/commands/dump_user.py
@@ -5,6 +5,9 @@ from coprs.logic import users_logic
@click.command()
@click.argument("username")
def dump_user(username):
+ """
+ Dump user
+ """
user = models.User.query.filter(models.User.username == username).first()
if not user:
print("There is no user named {0}.".format(username))
diff --git a/frontend/coprs_frontend/commands/get_admins.py
b/frontend/coprs_frontend/commands/get_admins.py
index f54708a..03647bb 100644
--- a/frontend/coprs_frontend/commands/get_admins.py
+++ b/frontend/coprs_frontend/commands/get_admins.py
@@ -3,5 +3,8 @@ from coprs import models
@click.command()
def get_admins():
+ """
+ Display list of admins
+ """
for u in models.User.query.filter(models.User.admin == True).all():
print(u.username)
diff --git a/frontend/coprs_frontend/commands/rawhide_to_release.py
b/frontend/coprs_frontend/commands/rawhide_to_release.py
index a650f54..a5ca187 100644
--- a/frontend/coprs_frontend/commands/rawhide_to_release.py
+++ b/frontend/coprs_frontend/commands/rawhide_to_release.py
@@ -19,6 +19,9 @@ from coprs.logic import coprs_logic, actions_logic, builds_logic,
packages_logic
required=True
)
def rawhide_to_release(rawhide_chroot, dest_chroot):
+ """
+ Branching
+ """
mock_chroot = coprs_logic.MockChrootsLogic.get_from_name(dest_chroot).first()
if not mock_chroot:
print("Given chroot does not exist. Please run:")
diff --git a/frontend/coprs_frontend/commands/test.py
b/frontend/coprs_frontend/commands/test.py
index 5d5fed4..e5600b8 100644
--- a/frontend/coprs_frontend/commands/test.py
+++ b/frontend/coprs_frontend/commands/test.py
@@ -12,6 +12,9 @@ import click
)
def test(coverage, arguments):
+ """
+ Runs tests
+ """
os.environ["COPRS_ENVIRON_UNITTEST"] = "1"
if not (("COPR_CONFIG" in os.environ) and
os.environ["COPR_CONFIG"]):
os.environ["COPR_CONFIG"] = "/etc/copr/copr_unit_test.conf"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date