File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! usr/bin/python3
2
+ # mcb.pyw - Saves and loads pieces of text to the clipboard.
3
+ # Usage: py.exe mcb.pyw save <keyword> - Saves clipboard to keyword.
4
+ # py.exe mcb.pyw <keyword> - Loads keyword to clipboard.
5
+ # py.exe mcb.pyw list - Loads all keywords to clipboard.
6
+
7
+ import shelve , pyperclip , sys
8
+
9
+ mcbShelf = shelve .open ('mcb' )
10
+
11
+ #TODO: Save clipboard content
12
+ if len (sys .argv ) == 3 and sys .argv [1 ].lower () == 'save' :
13
+ mcbShelf [sys .argv [2 ]] = pyperclip .paste ()
14
+
15
+ elif len (sys .argv ) == 2 :
16
+ #TODO: List keywords and load content
17
+ if mcbShelf [sys .argv [1 ]] == 'list' :
18
+ pyperclip .copy (str (list (mcbShelf .keys ())))
19
+ elif sys .argv [1 ] in mcbShelf :
20
+ pyperclip .copy (mcbShelf [sys .argv [1 ]])
21
+
22
+ mcbShelf .close ()
You can’t perform that action at this time.
0 commit comments