mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-20 05:37:43 +00:00
(Added) update label option for groups.
Added Drone CI/CD pipeline config.
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: publishing
|
||||||
|
image: python:3.10-alpine
|
||||||
|
environment:
|
||||||
|
PYPI_USERNAME:
|
||||||
|
from_secret: PYPI_USERNAME
|
||||||
|
PYPI_PASSWORD:
|
||||||
|
from_secret: PYPI_PASSWORD
|
||||||
|
commands:
|
||||||
|
- export POETRY_HOME=/opt/poetry
|
||||||
|
- python3 -m venv $POETRY_HOME
|
||||||
|
- $POETRY_HOME/bin/pip install poetry==1.3.2
|
||||||
|
- $POETRY_HOME/bin/poetry install
|
||||||
|
- $POETRY_HOME/bin/poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD
|
||||||
@@ -47,4 +47,7 @@
|
|||||||
Updated groups source creation.
|
Updated groups source creation.
|
||||||
** 0.8.10 <2023-03-25 Sat>
|
** 0.8.10 <2023-03-25 Sat>
|
||||||
Added *update labels* option for groups.
|
Added *update labels* option for groups.
|
||||||
|
** 0.8.11 <2023-04-01 Sat>
|
||||||
|
Added *update label* option for groups.
|
||||||
|
Added *Drone CI/CD* pipeline config.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "tui-rsync"
|
name = "tui-rsync"
|
||||||
version = "0.8.1"
|
version = "0.8.11"
|
||||||
description = ""
|
description = "tui-rsync will help you to manage yours backups."
|
||||||
authors = ["Kostiantyn Klochko <kostya_klochko@ukr.net>"]
|
authors = ["Kostiantyn Klochko <kostya_klochko@ukr.net>"]
|
||||||
readme = "README.rst"
|
readme = "README.rst"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
|
|||||||
@@ -30,6 +30,35 @@ from typer.main import get_group
|
|||||||
console = Console()
|
console = Console()
|
||||||
group_update = typer.Typer()
|
group_update = typer.Typer()
|
||||||
|
|
||||||
|
@group_update.command()
|
||||||
|
def label(
|
||||||
|
group_label: str = typer.Option(
|
||||||
|
None, "--group-label", "-l",
|
||||||
|
help="[b]The label[/] is a uniq identification of a [b]group[/].",
|
||||||
|
show_default=False
|
||||||
|
),
|
||||||
|
new_group_label: str = typer.Option(
|
||||||
|
None, "--new-group-label", "-nl",
|
||||||
|
help="[b]The new label[/] will replace the [b]old group label[/].",
|
||||||
|
show_default=False
|
||||||
|
),
|
||||||
|
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
[green b]Update[/] an [yellow]existing group label[/].
|
||||||
|
"""
|
||||||
|
if group_label is None:
|
||||||
|
console.print("What is the [yellow b]old label of group[/]? ")
|
||||||
|
group_label = GroupPrompt.get_label_fzf()
|
||||||
|
|
||||||
|
if new_group_label is None:
|
||||||
|
question = "What is the [yellow b]new label of the group[/]? "
|
||||||
|
new_group_label = GroupPrompt.ask_uuid(question)
|
||||||
|
|
||||||
|
if Group.is_exist(group_label):
|
||||||
|
group = Group.get_group(group_label)
|
||||||
|
group.update_label(new_group_label)
|
||||||
|
|
||||||
@group_update.command()
|
@group_update.command()
|
||||||
def labels(
|
def labels(
|
||||||
group_label: str = typer.Option(
|
group_label: str = typer.Option(
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def label(
|
|||||||
label = LabelPrompt.get_label_fzf()
|
label = LabelPrompt.get_label_fzf()
|
||||||
|
|
||||||
if new_label is None:
|
if new_label is None:
|
||||||
question = "What is the [yellow b]new label of source[/]? "
|
question = "What is the [yellow b]new label of the source[/]? "
|
||||||
new_label = LabelPrompt.ask_uuid(question)
|
new_label = LabelPrompt.ask_uuid(question)
|
||||||
|
|
||||||
if Source.is_exist(label):
|
if Source.is_exist(label):
|
||||||
|
|||||||
@@ -140,6 +140,10 @@ class Group(BaseModel):
|
|||||||
group.save()
|
group.save()
|
||||||
return group
|
return group
|
||||||
|
|
||||||
|
def update_label(self, new_label):
|
||||||
|
self.label = new_label
|
||||||
|
self.save()
|
||||||
|
|
||||||
def get_sources(self):
|
def get_sources(self):
|
||||||
"""
|
"""
|
||||||
Return iterator of the group sources.
|
Return iterator of the group sources.
|
||||||
|
|||||||
Reference in New Issue
Block a user