From 7f421c1d5cb7453f01abdb4dc8e222b51b4d5205 Mon Sep 17 00:00:00 2001 From: Dhanunjaya Varma <31201678+dhanunjaya-varma@users.noreply.github.com> Date: Wed, 24 Jul 2019 11:32:21 +0530 Subject: [PATCH 1/7] plugin to check iit mandi gateway network status --- jarviscli/plugins/networkstatus.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 jarviscli/plugins/networkstatus.py diff --git a/jarviscli/plugins/networkstatus.py b/jarviscli/plugins/networkstatus.py new file mode 100644 index 000000000..0654a5c22 --- /dev/null +++ b/jarviscli/plugins/networkstatus.py @@ -0,0 +1,16 @@ +from plugin import LINUX, PYTHON3, plugin, require +import os + +@require(python=PYTHON3, platform=LINUX) +@plugin('networkstatus') +def networkstatus(jarvis, s): + """Check status of IIT Mandi network: ping the gateway (10.8.0.1) and + check the response. Check the DNS using nslookup. Return "IIT Mandi + network is up" or "down" based on your tests""" + hostname = "10.8.0.1" + response = os.system("ping -c 1 " + hostname) + os.system("nslookup gateway.iitmandi.ac.in") + if response == 0: + jarvis.say ("IIT Mandi network is up") + else: + jarvis.say ('IIT Mandi network is down!') From da0b24aa40987ea162e0105225f0f701b7839b52 Mon Sep 17 00:00:00 2001 From: cegmunees <43857241+cegmunees@users.noreply.github.com> Date: Wed, 24 Jul 2019 14:58:58 +0530 Subject: [PATCH 2/7] Add files via upload --- jarviscli/plugins/busschedule.py | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 jarviscli/plugins/busschedule.py diff --git a/jarviscli/plugins/busschedule.py b/jarviscli/plugins/busschedule.py new file mode 100644 index 000000000..5f210359d --- /dev/null +++ b/jarviscli/plugins/busschedule.py @@ -0,0 +1,36 @@ + +from plugin import LINUX, PYTHON3, plugin, require +import tabula +import time as t + +@require(python=PYTHON3, platform=LINUX) +@plugin('busschedule') +def convert(s): + + # initialization of string to "" + new = "" + + # traverse in the string + for x in s: + new += x + + # return string + return new + +def busschedule(jarvis, s): + df2 = tabula.read_pdf("http://iitmandi.ac.in/files/inst_bus_schedule_12thjune2019.pdf", pages=2, multiple_tables=True) + arr=df2[0].get_values() + print(arr[8][3]) + ar=t.ctime().split(' ') + systime=ar[3].split(':') + flag=0 + for i in range(0,arr.shape[0]): + for j in range(3): + time=str(arr[i][3]) + arr3=time.split(':') + if( float(systime[0]) == float(arr3[0])): + if( float(systime[1]) >= float(arr3[1])): + print("next bus"+arr[i][3]) + flag=1 + if(flag==0): + print("No bus today") From f89576a22d86620db4f4d055b7309fab182d1286 Mon Sep 17 00:00:00 2001 From: Dhanunjaya Varma <31201678+dhanunjaya-varma@users.noreply.github.com> Date: Wed, 24 Jul 2019 15:16:21 +0530 Subject: [PATCH 3/7] Delete networkstatus.py --- jarviscli/plugins/networkstatus.py | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 jarviscli/plugins/networkstatus.py diff --git a/jarviscli/plugins/networkstatus.py b/jarviscli/plugins/networkstatus.py deleted file mode 100644 index 0654a5c22..000000000 --- a/jarviscli/plugins/networkstatus.py +++ /dev/null @@ -1,16 +0,0 @@ -from plugin import LINUX, PYTHON3, plugin, require -import os - -@require(python=PYTHON3, platform=LINUX) -@plugin('networkstatus') -def networkstatus(jarvis, s): - """Check status of IIT Mandi network: ping the gateway (10.8.0.1) and - check the response. Check the DNS using nslookup. Return "IIT Mandi - network is up" or "down" based on your tests""" - hostname = "10.8.0.1" - response = os.system("ping -c 1 " + hostname) - os.system("nslookup gateway.iitmandi.ac.in") - if response == 0: - jarvis.say ("IIT Mandi network is up") - else: - jarvis.say ('IIT Mandi network is down!') From 1f9114d2c665b53a98c0b601ed81a2029737e96c Mon Sep 17 00:00:00 2001 From: cegmunees <43857241+cegmunees@users.noreply.github.com> Date: Wed, 24 Jul 2019 15:17:29 +0530 Subject: [PATCH 4/7] Delete busschedule.py --- jarviscli/plugins/busschedule.py | 36 -------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 jarviscli/plugins/busschedule.py diff --git a/jarviscli/plugins/busschedule.py b/jarviscli/plugins/busschedule.py deleted file mode 100644 index 5f210359d..000000000 --- a/jarviscli/plugins/busschedule.py +++ /dev/null @@ -1,36 +0,0 @@ - -from plugin import LINUX, PYTHON3, plugin, require -import tabula -import time as t - -@require(python=PYTHON3, platform=LINUX) -@plugin('busschedule') -def convert(s): - - # initialization of string to "" - new = "" - - # traverse in the string - for x in s: - new += x - - # return string - return new - -def busschedule(jarvis, s): - df2 = tabula.read_pdf("http://iitmandi.ac.in/files/inst_bus_schedule_12thjune2019.pdf", pages=2, multiple_tables=True) - arr=df2[0].get_values() - print(arr[8][3]) - ar=t.ctime().split(' ') - systime=ar[3].split(':') - flag=0 - for i in range(0,arr.shape[0]): - for j in range(3): - time=str(arr[i][3]) - arr3=time.split(':') - if( float(systime[0]) == float(arr3[0])): - if( float(systime[1]) >= float(arr3[1])): - print("next bus"+arr[i][3]) - flag=1 - if(flag==0): - print("No bus today") From 17abf4e19f5a68494fd61e4b0eb1a53afea5aeca Mon Sep 17 00:00:00 2001 From: jjangra2 Date: Wed, 24 Jul 2019 15:32:11 +0530 Subject: [PATCH 5/7] Plugin to Check course slot --- jarviscli/plugins/course_plugin.py | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 jarviscli/plugins/course_plugin.py diff --git a/jarviscli/plugins/course_plugin.py b/jarviscli/plugins/course_plugin.py new file mode 100644 index 000000000..8be60c231 --- /dev/null +++ b/jarviscli/plugins/course_plugin.py @@ -0,0 +1,31 @@ +from plugin import plugin + +import numpy as np +import math +import tabula +@plugin("check slot for course") +#System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider") +def helloworld(jarvis, s): + # Read remote pdf into DataFrame + df2 = tabula.read_pdf("http://www.iitmandi.ac.in/academics/files/Timetable_Aug-Dec2019.pdf", pages=2) + arr=df2.get_values() + #print(arr) + count_row = df2.shape[0] # gives number of row count + t=0 + slot=0 + myDict={} + for x in np.nditer(arr, flags=["refs_ok"], op_flags=["readwrite"]): + if slot!=0: + if x==x : + myDict[(""+x)]=""+chr(slot+64) + t=t+1 + if t==count_row: + slot=slot+1 + t=0 + """Repeats what you type""" + try: + jarvis.say(myDict[s.upper()]) + except: + jarvis.say("Course not found!!!") + + From eeb1fbdaa1afb2dfeb93f2ed6fea42adc88e9e49 Mon Sep 17 00:00:00 2001 From: jjangra2 Date: Wed, 24 Jul 2019 15:39:04 +0530 Subject: [PATCH 6/7] Delete course_plugin.py --- jarviscli/plugins/course_plugin.py | 31 ------------------------------ 1 file changed, 31 deletions(-) delete mode 100644 jarviscli/plugins/course_plugin.py diff --git a/jarviscli/plugins/course_plugin.py b/jarviscli/plugins/course_plugin.py deleted file mode 100644 index 8be60c231..000000000 --- a/jarviscli/plugins/course_plugin.py +++ /dev/null @@ -1,31 +0,0 @@ -from plugin import plugin - -import numpy as np -import math -import tabula -@plugin("check slot for course") -#System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider") -def helloworld(jarvis, s): - # Read remote pdf into DataFrame - df2 = tabula.read_pdf("http://www.iitmandi.ac.in/academics/files/Timetable_Aug-Dec2019.pdf", pages=2) - arr=df2.get_values() - #print(arr) - count_row = df2.shape[0] # gives number of row count - t=0 - slot=0 - myDict={} - for x in np.nditer(arr, flags=["refs_ok"], op_flags=["readwrite"]): - if slot!=0: - if x==x : - myDict[(""+x)]=""+chr(slot+64) - t=t+1 - if t==count_row: - slot=slot+1 - t=0 - """Repeats what you type""" - try: - jarvis.say(myDict[s.upper()]) - except: - jarvis.say("Course not found!!!") - - From 32308080b86ae310a14a5bcc8695edfbb91a7ff8 Mon Sep 17 00:00:00 2001 From: Aniket Sahu Date: Wed, 25 Sep 2019 16:03:57 +0530 Subject: [PATCH 7/7] Add infob17057 plugin --- jarviscli/plugins/infob17057.py | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 jarviscli/plugins/infob17057.py diff --git a/jarviscli/plugins/infob17057.py b/jarviscli/plugins/infob17057.py new file mode 100644 index 000000000..e9e440567 --- /dev/null +++ b/jarviscli/plugins/infob17057.py @@ -0,0 +1,36 @@ +from plugin import plugin +from colorama import Fore +import time + +@plugin("infob17057") +def infob17057(jarvis, s): + """Command by B17057 ~ Saransh Sharma""" + # Menu + jarvis.say("Welcome to the info plugin of Saransh Sharma roll num B17057. Please select one of the options below:") + jarvis.say(Fore.CYAN+"[F]ull name") + jarvis.say(Fore.CYAN+"[H]ometown") + jarvis.say(Fore.CYAN+"Favourite [M]ovie") + jarvis.say(Fore.CYAN+"Favourite [S]portsperson") + jarvis.say(Fore.CYAN+"Launch [P]ython program written by me") + inp = jarvis.input() + + # Impementation of Menu + if inp == 'F' or inp == 'f': + jarvis.say("Hi! My name is Saransh Sharma.") + elif inp == 'H' or inp == 'h': + jarvis.say("I am from Delhi.") + elif inp == 'M' or inp == 'm': + jarvis.say("Well, that would be Megamind") + elif inp == 'S' or inp == 's': + jarvis.say("LeBron James") + elif inp == 'P' or inp == 'p': + jarvis.say("Sorry") + i = int(1) #Program + while True: + jarvis.say( + Fore.GREEN + +str(i)) + time.sleep(1) + i = i + 1 + else: + jarvis.say("Incorrect Selection") \ No newline at end of file