remove unused code

This commit is contained in:
Kovid Goyal
2023-07-20 10:30:57 +05:30
parent a2df829912
commit 86a1a40d1d
2 changed files with 2 additions and 30 deletions

View File

@@ -2,12 +2,8 @@
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
import os
import sys
from typing import List, Tuple
from kitty.cli import parse_args
from kitty.cli_stub import TransferCLIOptions
from typing import List
usage = 'source_files_or_directories destination_path'
help_text = 'Transfer files over the TTY device'
@@ -56,29 +52,6 @@ actually degrade performance on fast links with small files, so use with care.
'''
def parse_transfer_args(args: List[str]) -> Tuple[TransferCLIOptions, List[str]]:
return parse_args(
args[1:], option_text, usage, help_text,
'kitty +kitten transfer', result_class=TransferCLIOptions
)
def read_bypass(loc: str) -> str:
if not loc:
return ''
if loc.isdigit() and int(loc) >= 0 and int(loc) < 256:
with open(int(loc), 'rb') as f:
return f.read().decode('utf-8')
if loc[0] in ('.', '~', '/'):
if loc[0] == '~':
loc = os.path.expanduser(loc)
with open(loc, 'rb') as f:
return f.read().decode('utf-8')
if loc == '-':
return sys.stdin.read()
return loc
def main(args: List[str]) -> None:
raise SystemExit('This should be run as kitten transfer')