Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
fresh2dev committed Jul 28, 2023
2 parents fc6f3ea + 5c5059d commit efa9973
Show file tree
Hide file tree
Showing 13 changed files with 535 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.0a0
current_version = 0.1.0a1
commit = False
message = bump: {current_version} --> {new_version}
tag = False
Expand Down
8 changes: 4 additions & 4 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Changes here will be overwritten by Copier
_commit: 4964f16
_commit: a01a11e
_src_path: https://codeberg.org/Fresh2dev/copier-f2dv-project.git
author_email: [email protected]
author_name: Donald Mellenbruch
ci_domain_name: lokalhost.net
docs_url: https://www.f2dv.com/code/r/tuiview/i
docs_url: https://www.f2dv.com/r/tuiview
funding_url: https://www.f2dv.com/fund
home_domain: f2dv.com
home_page: https://www.f2dv.com
is_minimal: false
is_python: true
license_type: GPLv3
package_name: tuiview
project_description: A TUI for every CLI
project_description: A TUI for every CLI.
project_name: tuiview
python_version: '3.8'
repo_mirror: https://www.f2dv.com/code/r/tuiview
repo_mirror: https://www.f2dv.com/r/tuiview
repo_name: fresh2dev/tuiview
repo_owner: fresh2dev
repo_url: https://www.github.com/fresh2dev/tuiview
Expand Down
9 changes: 7 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ kind: template
load: hostbutter.jsonnet
data:
domains: >-
["lokalhost.net"]
["lokalhost.net", "fresh2.dev"]
domainTriggers: >-
{
"lokalhost.net": {}
"lokalhost.net": {
"event": {"exclude": ["promote"]}
},
"fresh2.dev": {
"event": ["promote", "tag"]
}
}
domainClusterMap: >-
{}
Expand Down
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: ["https://www.f2dv.com/fund", "https://www.f2dv.com/paypal"]
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

## 0.1.0a1 - 2023-07-28

- Initial pre-release

SLOC Analysis:

| Directory | Empty | Comment | Docstring | Code | Statements |
|-------------|---------|-----------|-------------|--------|--------------|
| src/tuiview | 119 | 12 | 226 | 790 | 300 |
| tests | 24 | 3 | 1 | 72 | 58 |
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG HB_IMAGE_REGISTRY=docker.io
FROM ${HB_IMAGE_REGISTRY}/python:3.10.10-slim-bullseye as build
LABEL org.opencontainers.image.source=https://www.github.com/fresh2dev/tuiview
LABEL org.opencontainers.image.description="A TUI for every CLI"
LABEL org.opencontainers.image.description="A TUI for every CLI."
LABEL org.opencontainers.image.licenses=GPLv3
RUN apt-get update && apt-get install --upgrade -y build-essential git
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-docs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG HB_IMAGE_REGISTRY=docker.io
FROM ${HB_IMAGE_REGISTRY}/nginx:1
LABEL org.opencontainers.image.source=https://www.github.com/fresh2dev/tuiview
LABEL org.opencontainers.image.description="A TUI for every CLI"
LABEL org.opencontainers.image.description="A TUI for every CLI."
LABEL org.opencontainers.image.licenses=GPLv3
ARG CONTENT_PATH=public
COPY $CONTENT_PATH /usr/share/nginx/html
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# TUIview [`tv`]

> A TUI for every CLI
| Links | |
|---------------|------------------------|
| Code Repo | https://www.github.com/fresh2dev/tuiview |
| Mirror Repo | https://www.f2dv.com/code/r/tuiview |
| Documentation | https://www.f2dv.com/code/r/tuiview/i |
| Changelog | https://www.f2dv.com/code/r/tuiview/i/changelog |
| License | https://www.f2dv.com/code/r/tuiview/i/license |
| Funding | https://www.f2dv.com/fund |

[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.github.com/fresh2dev/tuiview/releases)
[![GitHub Release Date](https://img.shields.io/github/release-date/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.github.com/fresh2dev/tuiview/releases)
[![License](https://img.shields.io/github/license/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.f2dv.com/code/r/tuiview/i/license)
> A TUI for every CLI.
| Links | |
|---------------|------------------------------------------|
| Code Repo | https://www.github.com/fresh2dev/tuiview |
| Mirror Repo | https://www.f2dv.com/r/tuiview |
| Documentation | https://www.f2dv.com/r/tuiview |
| Changelog | https://www.f2dv.com/r/tuiview/changelog |
| License | https://www.f2dv.com/r/tuiview/license |
| Funding | https://www.f2dv.com/fund |

[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.f2dv.com/r/tuiview/changelog)
[![GitHub Release Date](https://img.shields.io/github/release-date/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.f2dv.com/r/tuiview/changelog)
[![License](https://img.shields.io/github/license/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.f2dv.com/r/tuiview/license)
[![GitHub Repo stars](https://img.shields.io/github/stars/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://star-history.com/#fresh2dev/tuiview&Date)
[![GitHub issues](https://img.shields.io/github/issues-raw/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.github.com/fresh2dev/tuiview/issues)
[![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://www.github.com/fresh2dev/tuiview/pulls)
[![GitHub Repo stars](https://img.shields.io/github/stars/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://star-history.com/#fresh2dev/tuiview&Date)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/tuiview?color=blue&style=for-the-badge)](https://pypi.org/project/tuiview)
[![Docker Pulls](https://img.shields.io/docker/pulls/fresh2dev/tuiview?color=blue&style=for-the-badge)](https://hub.docker.com/r/fresh2dev/tuiview)
[![Docs Website](https://img.shields.io/website?down_message=unavailable&label=docs&style=for-the-badge&up_color=blue&up_message=available&url=https://www.f2dv.com/code/r/tuiview/i)](https://www.f2dv.com/code/r/tuiview/i)
[![Coverage Website](https://img.shields.io/website?down_message=unavailable&label=coverage&style=for-the-badge&up_color=blue&up_message=available&url=https://www.f2dv.com/code/r/tuiview/i/tests/coverage)](https://www.f2dv.com/code/r/tuiview/i/tests/coverage)
[![Changelog](https://img.shields.io/website?down_message=unavailable&label=docs&style=for-the-badge&up_color=blue&up_message=available&url=https://www.f2dv.com/r/tuiview/changelog)](https://www.f2dv.com/r/tuiview/changelog)
[![Funding](https://img.shields.io/badge/funding-%24%24%24-blue?style=for-the-badge)](https://www.f2dv.com/fund)

---
Expand Down
6 changes: 3 additions & 3 deletions config/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site_name: "tuiview"
site_description: "tuiview Docs"
site_url: !ENV [MKDOCS_SITE_URL, "https://www.f2dv.com/code/r/tuiview/i"]
site_url: !ENV [MKDOCS_SITE_URL, "https://www.f2dv.com/r/tuiview"]
repo_url: "https://www.github.com/fresh2dev/tuiview"
repo_name: "fresh2dev/tuiview"
edit_uri: "edit/main/docs"
Expand All @@ -25,8 +25,8 @@ nav:
- License: license.md
- Discussion: comments.md
- '<- f2dv.com':
- '/blog': 'https://www.f2dv.com'
- '/code': 'https://www.f2dv.com/code/r/'
- '/home': 'https://www.f2dv.com'
- '/code': 'https://www.f2dv.com/projects'
- '/fund': 'https://www.f2dv.com/fund'

watch:
Expand Down
2 changes: 1 addition & 1 deletion docs/page/related.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ argparse-tui is a fork of Trogon.

Textual is the Python TUI framework that powers Trogon and argparse-tui.

## [Yapx](https://www.f2dv.com/code/r/yapx/i/)
## [Yapx](https://www.f2dv.com/r/yapx)

Yapx is a CLI library built on top of argparse which makes it easy to build argparse CLIs using Python type-hints. The command-line interface of this project is built using yapx.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "tuiview"
authors = [
{name = "Donald Mellenbruch", email = "[email protected]"},
]
description = "A TUI for every CLI"
description = "A TUI for every CLI."
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.8"
Expand All @@ -17,7 +17,7 @@ classifiers = [
dynamic = ["version"]
dependencies = [
"typing-extensions; python_version<'3.10'",
"yapx[tui]>=0.2.1,<1",
"yapx[tui]>=0.2.2,<1",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -57,7 +57,7 @@ tests = [
]

[project.urls]
Homepage = "https://www.f2dv.com/code/r/tuiview/i"
Homepage = "https://www.f2dv.com/r/tuiview"
Repository = "https://www.github.com/fresh2dev/tuiview"
Funding = "https://www.f2dv.com/fund"

Expand Down
21 changes: 12 additions & 9 deletions src/tuiview/__main__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import sys
from importlib import import_module
from pathlib import Path
from typing import Optional
from typing import Any, Callable, Dict, Optional

import yapx
from argparse_tui import invoke_tui
from yapx.types import Annotated

from .__version__ import __version__
from .cmd.git import main as git_main
from .cmd.grep import main as grep_main
from .cmd.rsync import main as rsync_main


def setup(
Expand All @@ -26,13 +23,19 @@ def setup(


def main() -> None:
named_subcommands: Dict[str, Callable[..., Any]] = {}

for x in (Path(__file__).parent / "cmd").glob("*.py"):
if not x.name.startswith("_"):
cmd_module = import_module(
f".{x.parent.stem}.{x.stem}",
package=__package__,
)
named_subcommands[x.stem.replace("_", "-")] = cmd_module.main

yapx.run(
setup,
named_subcommands={
"git": git_main,
"rsync": rsync_main,
"grep": grep_main,
},
named_subcommands=named_subcommands,
prog_version=__version__,
default_args=["--help"],
tui_flags=[],
Expand Down
Loading

0 comments on commit efa9973

Please sign in to comment.