Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a Rosary Mysteries plugin (may not be properly integrated) #1112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jarviscli/Jarvis.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _rel_path_fix(self, dirs):
return dirs_abs

def default(self, data):
"""Jarvis let's you know if an error has occurred."""
"""Jarvis lets you know if an error has occurred."""
print_say("I could not identify your command...", self, Fore.MAGENTA)

def precmd(self, line):
Expand Down
4 changes: 2 additions & 2 deletions jarviscli/plugins/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@require(network=True)
@plugin("activity")
def activity(jarvis, s):
"""Tells a activity to do when you're bored, powered by www.boredapi.com"""
"""Tells an activity to do when you're bored, powered by www.boredapi.com"""

req = requests.get("https://www.boredapi.com/api/activity")
data = req.json()
Expand All @@ -17,7 +17,7 @@ def activity(jarvis, s):
return

if data.get('accessibility') < 0.4:
response += "I can purpose something interesting but it's not easy and "
response += "I can propose something interesting but it's not easy and "
elif data.get('accessibility') < 0.6:
response += "I have something easy for you and "

Expand Down
58 changes: 58 additions & 0 deletions jarviscli/plugins/rosary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import datetime
from plugin import plugin

@plugin('rosary')
def rosary(jarvis, s):
##Provides names of the days of the week
weekdayList = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
'Saturday', 'Sunday']
##Function to convert the index of the weekday into the date
##(eg Monday, Tuesday)
def convertDayIndexToWord():
return weekdayList[y]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y isn't really defined?

##Fetches the day of the week
y = datetime.datetime.today().weekday()
##Calls the function
convertDayIndexToWord()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really do anything. Your method just returns a string - which you are ignoring?

##Displays the day of the week in user-readable format
print('Today is', weekdayList[y])
##Uses the weekday to display the appropriate mysteries of the Rosary
##TODO would probably have been better to write these as lists or something
##instead of printing them straight out
##TODO add a 'trad mode' to change Thursday's mysteries to whatever it was before
##JPII introduced the Luminous Mysteries
##TODO Maybe add clickable beads?
if y == 1 or y == 4:
print("Today's mysteries of the Rosary are the Sorrowful Mysteries.")
print("The Sorrowful Mysteries are:")
print("1. The Agony in the Garden")
print("2. The Scourging at the Pillar")
print("3. The Crowning of Thorns")
print("4. The Carrying of the Cross")
print("5. The Crucifixion and Death of Our Lord")
elif y == 0 or y == 5:
print("Today's mysteries of the Rosary are the Joyful Mysteries.")
print("The Joyful Mysteries are:")
print("1. The Annunciation")
print("2. The Visitation")
print("3. The Nativity")
print("4. The Presentation in the Temple")
print("5. The Finding of Our Lord in the Temple")
elif y == 3 or y == 6:
print("Today's mysteries of the Rosary are the Glorious Mysteries.")
print("The Glorious Mysteries are:")
print("1. The Resurrection")
print("2. The Ascension")
print("3. The Descent of the Holy Spirit at Pentecost")
print("4. The Dormition of the Theotokos")
print("5. The Crowing of the Theotokos as Queen of Heaven")
elif y == 3:
print("Today's mysteries of the Rosary are the Luminous Mysteries.")
print("The Luminous Mysteries are:")
print("1. The Baptism of Our Lord")
print("2. The Wedding at Cana")
print("3. The Preaching of the Gospel")
print("4. The Transfiguration of Our Lord")
print("5. The Institution of the Holy Eucharist")
else: ##Input Validation
print('Oops! Something went wrong with fetching the date.')