File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from textual import work
1010
1111from rovr .app import Application
12+ from rovr .functions .cwd import getcwd
1213from rovr .screens .yes_or_no import YesOrNo
1314from rovr .variables .constants import config
1415
@@ -91,6 +92,35 @@ async def conn(
9192 }
9293 for option in options
9394 ]
95+ case "paste" :
96+ if not await check_permission (self , action , args ):
97+ ok = False
98+ err = "denied"
99+ else :
100+ selected_items = (
101+ self .Clipboard .selected
102+ ) # dont include highlighted
103+ to_copy , to_cut = (
104+ [
105+ item .path
106+ for item in selected_items
107+ if item .type_of_selection == "copy"
108+ ],
109+ [
110+ item .path
111+ for item in selected_items
112+ if item .type_of_selection == "cut"
113+ ],
114+ )
115+ # we will be ignoring the prompt that PasteButton
116+ # does because we are assuming that ipc paste is
117+ # a prompt (default) else the person kniws what
118+ # they want from rovr
119+ worker = self .app .query_one ("ProcessContainer" ).paste_items (
120+ to_copy , to_cut , getcwd ()
121+ )
122+ await worker .wait ()
123+ out = {"copy" : len (to_copy ), "cut" : len (to_cut )}
94124 case "copy" | "cut" :
95125 if not await check_permission (self , action , args ):
96126 ok = False
You can’t perform that action at this time.
0 commit comments