[~] Refactor
This commit is contained in:
parent
2522ed4ac4
commit
34c3ed74eb
@ -0,0 +1,46 @@
|
|||||||
|
// Place your key bindings in this file to override the defaults
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "alt+z",
|
||||||
|
"command": "-editor.action.toggleWordWrap"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "alt+z",
|
||||||
|
"command": "-workbench.action.terminal.sizeToContentWidth",
|
||||||
|
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen || terminalFocus && terminalIsOpen && terminalProcessSupported"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "alt+z",
|
||||||
|
"command": "workbench.action.toggleMaximizeEditorGroup",
|
||||||
|
"when": "editorPartMaximizedEditorGroup || editorPartMultipleEditorGroups"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+k ctrl+m",
|
||||||
|
"command": "-workbench.action.toggleMaximizeEditorGroup",
|
||||||
|
"when": "editorPartMaximizedEditorGroup || editorPartMultipleEditorGroups"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "alt+z",
|
||||||
|
"command": "workbench.action.toggleMaximizedPanel",
|
||||||
|
"when": "!editorTextFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+p",
|
||||||
|
"command": "-extension.vim_ctrl+p",
|
||||||
|
"when": "editorTextFocus && vim.active && vim.use<C-p> && !inDebugRepl || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "alt+t",
|
||||||
|
"command": "workbench.action.terminal.toggleTerminal",
|
||||||
|
"when": "terminal.active"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+`",
|
||||||
|
"command": "-workbench.action.terminal.toggleTerminal",
|
||||||
|
"when": "terminal.active"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+e",
|
||||||
|
"command": "-workbench.action.quickOpen"
|
||||||
|
}
|
||||||
|
]
|
@ -9,6 +9,7 @@ import datetime
|
|||||||
import functools
|
import functools
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
|
import pathlib
|
||||||
import logging
|
import logging
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
@ -1610,9 +1611,9 @@ def aioice_tunnel(argv: list[str]) -> None:
|
|||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
t1 = await test()
|
#t1 = await test()
|
||||||
|
|
||||||
await asyncio.sleep(999)
|
#await asyncio.sleep(999)
|
||||||
|
|
||||||
def player_v1(folder_url, item_id):
|
def player_v1(folder_url, item_id):
|
||||||
#import sys
|
#import sys
|
||||||
@ -3688,6 +3689,13 @@ def install(argv: list[str]) -> None:
|
|||||||
type=pathlib.Path,
|
type=pathlib.Path,
|
||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'-p', '--relative',
|
||||||
|
type=pathlib.Path,
|
||||||
|
help='copy source relative to path, allows to strip extra components',
|
||||||
|
dest='relative',
|
||||||
|
default=None,
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-t', '--target',
|
'-t', '--target',
|
||||||
type=pathlib.Path,
|
type=pathlib.Path,
|
||||||
@ -3700,25 +3708,39 @@ def install(argv: list[str]) -> None:
|
|||||||
help='overwrite if target is present',
|
help='overwrite if target is present',
|
||||||
dest='overwrite',
|
dest='overwrite',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
defualt=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
options, args = parser.parse_known_args(argv)
|
options, args = parser.parse_known_args(argv)
|
||||||
|
|
||||||
|
if options.relative:
|
||||||
|
relative_source = options.source.relative_to(options.relative)
|
||||||
|
else:
|
||||||
|
if options.source.is_absolute():
|
||||||
|
relative_source = options.source.relative_to('/')
|
||||||
|
else:
|
||||||
|
relative_source = options.source
|
||||||
|
|
||||||
logger.info(dict(source=options.source, target=options.source))
|
logger.info(dict(source=options.source, target=options.source))
|
||||||
|
|
||||||
if options.target.exists():
|
final_target = options.target / relative_source
|
||||||
|
|
||||||
|
logger.info(dict(final_target=final_target, relative_source=relative_source))
|
||||||
|
|
||||||
|
if final_target.exists():
|
||||||
if not options.overwrite:
|
if not options.overwrite:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
shutil.rmtree(str(options.target))
|
shutil.rmtree(str(final_target))
|
||||||
|
|
||||||
if option.source.is_dir() and not options.recursive:
|
if options.source.is_dir() and not options.recursive:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
os.makedirs(final_target, exist_ok=True,)
|
||||||
|
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
options.source,
|
options.source,
|
||||||
options.target,
|
final_target,
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info(dict(msg='done'))
|
logger.info(dict(msg='done'))
|
||||||
|
Loading…
Reference in New Issue
Block a user