From 8606a5d746b228d36c28a275ed7801e437c710e1 Mon Sep 17 00:00:00 2001 From: Shrey Patel Date: Sun, 29 Aug 2021 11:03:23 +0530 Subject: [PATCH 1/2] New Plugin ScreenShot PLugin helps : 1. Ease of Access. 2. Keeping Log for Issues in Local Runtime --- jarviscli/plugins/screenshot.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 jarviscli/plugins/screenshot.py diff --git a/jarviscli/plugins/screenshot.py b/jarviscli/plugins/screenshot.py new file mode 100644 index 000000000..bbf62bf4f --- /dev/null +++ b/jarviscli/plugins/screenshot.py @@ -0,0 +1,30 @@ +import pyautogui +# some_file.py +import sys +# insert at 1, 0 is the script path (or '' in REPL) +sys.path.insert(1, 'jarviscli') + +import CmdInterpreter +import requests +from colorama import Fore +from plugin import plugin, require +import os + +@require(network=True) +@plugin("screenshot") +def ss(jarvis,s): + if (s): + data = CmdInterpreter.input() + if data == "": + jarvis.say("Sorry, an error occured", Fore.BLUE) + return + elif(data == "/ss") or (data == "/screenshot") or (data == "/capture") : + jarvis.say("Please give me a moment", Fore.BLUE) + incr += 1 + incr = str(incr) + myScreenshot = pyautogui.screenshot() + myScreenshot.save(r'./../ss'+incr+'.png') + if(os.path.isfile('./../ss'+incr+'.png')==False): + jarvis.say("Success!", Fore.BLUE) + else: + jarvis.say("Sorry, an error occured retry using /ss , /screenshot, /capture", Fore.RED) From 15b81369b2dbd6820ff7d310833798243db69b05 Mon Sep 17 00:00:00 2001 From: Shrey Patel Date: Sun, 29 Aug 2021 11:07:14 +0530 Subject: [PATCH 2/2] Update requirements.txt --- installer/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/requirements.txt b/installer/requirements.txt index bd242a1d7..87704092f 100644 --- a/installer/requirements.txt +++ b/installer/requirements.txt @@ -44,3 +44,4 @@ Image img2pdf pdf2image python-nmap +pyautogui