fast-dev-cli 0.25.6__tar.gz → 0.25.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fast_dev_cli-0.25.6 → fast_dev_cli-0.25.7}/PKG-INFO +1 -1
- fast_dev_cli-0.25.7/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.25.6 → fast_dev_cli-0.25.7}/fast_dev_cli/cli.py +59 -0
- {fast_dev_cli-0.25.6 → fast_dev_cli-0.25.7}/pyproject.toml +2 -1
- fast_dev_cli-0.25.6/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.25.6 → fast_dev_cli-0.25.7}/LICENSE +0 -0
- {fast_dev_cli-0.25.6 → fast_dev_cli-0.25.7}/README.md +0 -0
- {fast_dev_cli-0.25.6 → fast_dev_cli-0.25.7}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.25.6 → fast_dev_cli-0.25.7}/fast_dev_cli/py.typed +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.25.7"
|
|
@@ -2241,6 +2241,65 @@ def pypi(
|
|
|
2241
2241
|
UvPypi(p, dry, verbose, quiet, slim, reverse).run()
|
|
2242
2242
|
|
|
2243
2243
|
|
|
2244
|
+
class SuffixParser:
|
|
2245
|
+
usually = ("py", "md", "json", "txt", "proto")
|
|
2246
|
+
|
|
2247
|
+
@classmethod
|
|
2248
|
+
def fill(cls, files: list[str]) -> list[str]:
|
|
2249
|
+
names = []
|
|
2250
|
+
for f in files:
|
|
2251
|
+
if f.endswith("."):
|
|
2252
|
+
f = cls.guess(f)
|
|
2253
|
+
else:
|
|
2254
|
+
p = Path(f)
|
|
2255
|
+
if not Path(f).suffix and not p.exists():
|
|
2256
|
+
f = cls.guess(f, ".")
|
|
2257
|
+
names.append(f)
|
|
2258
|
+
return names
|
|
2259
|
+
|
|
2260
|
+
@classmethod
|
|
2261
|
+
def guess(cls, file: str, sep: str = "") -> str:
|
|
2262
|
+
for s in cls.usually:
|
|
2263
|
+
f = file + sep + s
|
|
2264
|
+
if os.path.exists(f):
|
|
2265
|
+
return f
|
|
2266
|
+
p = Path(file)
|
|
2267
|
+
d = p.parent
|
|
2268
|
+
ff = list(d.glob(p.name + sep + "*"))
|
|
2269
|
+
match len(ff):
|
|
2270
|
+
case 0:
|
|
2271
|
+
...
|
|
2272
|
+
case 1:
|
|
2273
|
+
return ff[0].as_posix()
|
|
2274
|
+
case _:
|
|
2275
|
+
typer.echo(f"Found several match files: {ff}")
|
|
2276
|
+
return file
|
|
2277
|
+
|
|
2278
|
+
|
|
2279
|
+
@cli.command()
|
|
2280
|
+
def vi(
|
|
2281
|
+
files: Annotated[list[str], typer.Argument()],
|
|
2282
|
+
dry: Annotated[
|
|
2283
|
+
bool, Option(help="Only print, not really run shell command")
|
|
2284
|
+
] = False,
|
|
2285
|
+
vertical: bool | None = Option(None, "-O", help="Open vertically"),
|
|
2286
|
+
horizon: bool | None = Option(None, "-o", help="Open horizontally"),
|
|
2287
|
+
guess: Annotated[
|
|
2288
|
+
bool, Option(help="Whether guess file suffix if not exist")
|
|
2289
|
+
] = True,
|
|
2290
|
+
) -> None:
|
|
2291
|
+
cmd = "vim "
|
|
2292
|
+
if len(files) > 1:
|
|
2293
|
+
if horizon:
|
|
2294
|
+
cmd += "-o "
|
|
2295
|
+
elif vertical is not False:
|
|
2296
|
+
cmd += "-O "
|
|
2297
|
+
if guess:
|
|
2298
|
+
files = SuffixParser.fill(files)
|
|
2299
|
+
cmd += " ".join(files)
|
|
2300
|
+
exit_if_run_failed(cmd, dry=dry)
|
|
2301
|
+
|
|
2302
|
+
|
|
2244
2303
|
def version_callback(value: bool) -> None:
|
|
2245
2304
|
if value:
|
|
2246
2305
|
echo("Fast Dev Cli Version: " + typer.style(__version__, bold=True))
|
|
@@ -29,7 +29,7 @@ dependencies = [
|
|
|
29
29
|
"typer>=0.24.0,<1",
|
|
30
30
|
"tomli >=2.0.1,<3; python_version < '3.11'",
|
|
31
31
|
]
|
|
32
|
-
version = "0.25.
|
|
32
|
+
version = "0.25.7"
|
|
33
33
|
|
|
34
34
|
[project.urls]
|
|
35
35
|
Homepage = "https://github.com/waketzheng/fast-dev-cli"
|
|
@@ -55,6 +55,7 @@ dev = [
|
|
|
55
55
|
"asynctor>=0.13.0",
|
|
56
56
|
"httpx2>=2.5.0",
|
|
57
57
|
"tomli-w>=1.2.0",
|
|
58
|
+
"twine>=7.0.0",
|
|
58
59
|
]
|
|
59
60
|
|
|
60
61
|
[build-system]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.25.6"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|