We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec03da7 commit cf99650Copy full SHA for cf99650
links/short.py
@@ -60,8 +60,9 @@ def gen_unused_short(redirects: dict) -> Iterator[str]:
60
yield short
61
62
63
-def shorten(urls: list[str], redirects: dict, targets: dict) -> list[tuple[str, str]]:
+def shorten(urls: list[str]) -> list[tuple[str, str]]:
64
"""Return (short, long) pairs, appending directives to HTACCESS_SHORT as needed."""
65
+ redirects, targets = load_redirects()
66
iter_short = gen_unused_short(redirects)
67
pairs = []
68
timestamp = strftime('%Y-%m-%d %H:%M:%S')
@@ -86,8 +87,7 @@ def shorten(urls: list[str], redirects: dict, targets: dict) -> list[tuple[str,
86
87
def main() -> None:
88
"""read URLS from filename arguments or stdin"""
89
urls = [line.strip() for line in fileinput.input(encoding='utf-8')]
- redirects, targets = load_redirects()
90
- for short, long in shorten(urls, redirects, targets):
+ for short, long in shorten(urls):
91
print(f'{BASE_DOMAIN}/{short}\t{long}')
92
93
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments