Migrate some calls to clipext to pipeable.

This commit is contained in:
voussoir 2021-07-27 09:57:38 -07:00
parent de5aca14a9
commit 307bf2e698
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
3 changed files with 7 additions and 8 deletions

View file

@ -8,7 +8,7 @@ import time
import traceback import traceback
import zipfile import zipfile
from voussoirkit import clipext from voussoirkit import pipeable
from voussoirkit import interactive from voussoirkit import interactive
FILENAME_BADCHARS = '\\/:*?<>|"' FILENAME_BADCHARS = '\\/:*?<>|"'
@ -97,7 +97,7 @@ def getcrx_argparse(args):
extension_ids = [] extension_ids = []
if len(args.extension_ids) == 1: if len(args.extension_ids) == 1:
extension_ids.extend(clipext.resolve(args.extension_ids[0], split_lines=True)) extension_ids.extend(pipeable.input(args.extension_ids[0]))
elif args.extension_ids: elif args.extension_ids:
extension_ids.extend(args.extension_ids) extension_ids.extend(args.extension_ids)

View file

@ -5,9 +5,9 @@ import sys
import json import json
import requests import requests
from voussoirkit import clipext from voussoirkit import pipeable
urls = clipext.resolve(sys.argv[1], split_lines=True) urls = pipeable.input(sys.argv[1], skip_blank=True, strip=True)
for url in urls: for url in urls:
page = requests.head(url) page = requests.head(url)
headers = dict(page.headers) headers = dict(page.headers)

View file

@ -4,12 +4,11 @@ Print input lines in reverse order.
import argparse import argparse
import sys import sys
from voussoirkit import clipext from voussoirkit import pipeable
def reverse_argparse(args): def reverse_argparse(args):
lines = clipext.resolve(args.lines) lines = list(pipeable.input(args.lines))
lines = lines.splitlines() lines.reverse()
lines = reversed(lines)
print('\n'.join(lines)) print('\n'.join(lines))
def main(argv): def main(argv):