mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-05 15:41:39 +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')
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ import tempfile
|
||||
import zlib
|
||||
from pathlib import Path
|
||||
|
||||
from kittens.transfer.main import parse_transfer_args
|
||||
from kittens.transfer.receive import File, files_for_receive
|
||||
from kittens.transfer.rsync import Differ, Hasher, Patcher, decode_utf8_buffer, parse_ftc
|
||||
from kittens.transfer.utils import cwd_path, expand_home, home_path, set_paths
|
||||
from kitty.file_transmission import Action, Compression, FileTransmissionCommand, FileType, TransmissionType, ZlibDecompressor, iter_file_metadata
|
||||
@@ -438,6 +436,7 @@ class TestFileTransmission(BaseTest):
|
||||
t('a1=b1;c=d;;;1=1', 'a1', 'b1', 'c', 'd', '1', '1')
|
||||
|
||||
def test_path_mapping_receive(self):
|
||||
self.skipTest('TODO: Port this test')
|
||||
opts = parse_transfer_args([])[0]
|
||||
b = Path(os.path.join(self.tdir, 'b'))
|
||||
os.makedirs(b)
|
||||
|
||||
Reference in New Issue
Block a user