mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 16:05:02 +02:00
remove unused code
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user