Advertisement
DarkPotatoKing

Rosary.py

Aug 17th, 2014
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.59 KB | None | 0 0
  1. import datetime
  2.  
  3.  
  4. def get_day_today():
  5.     return datetime.datetime.today().weekday()
  6.  
  7.  
  8. def mystery(n):
  9.     MONDAY = 0
  10.     TUESDAY = 1
  11.     WEDNESDAY = 2
  12.     THURSDAY = 3
  13.     FRIDAY = 4
  14.     SATURDAY = 5
  15.     SUNDAY = 6
  16.  
  17.     GLORIOUS = 0
  18.     JOYFUL = 1
  19.     SORROWFUL = 2
  20.     LUMINOUS = 3
  21.  
  22.     joyful_mysteries = ['The Annunciation', 'The Visitation', 'The Nativity', 'The Presentation',
  23.                         'The Finding in the Temple']
  24.     sorrowful_mysteries = ['The Agony in the Garden', 'The Scourging at the Pillar', 'The Crowning with Thorns',
  25.                            'The Carrying of the Cross', 'The Crucifixion']
  26.     glorious_mysteries = ['The Resurrection', 'The Ascension', 'The Descent of the Holy Spirit', 'The Assumption',
  27.                           'The Coronation of Our Lady']
  28.     luminous_mysteries = ['The Baptism of Christ in the Jordan', 'The Wedding Feast at Cana',
  29.                           'The Announcement of the Kingdom', 'The Transfiguration', 'The Institution of the Eucharist']
  30.  
  31.     day_today = get_day_today()
  32.     mystery = 0
  33.  
  34.     current_mystery = ''
  35.  
  36.     if day_today == SUNDAY or day_today == WEDNESDAY:
  37.         mystery = GLORIOUS
  38.     elif day_today == MONDAY or day_today == SATURDAY:
  39.         mystery = JOYFUL
  40.     elif day_today == TUESDAY or day_today == FRIDAY:
  41.         mystery = SORROWFUL
  42.     elif day_today == THURSDAY:
  43.         mystery = LUMINOUS
  44.  
  45.     name = ''
  46.  
  47.     if mystery == GLORIOUS:
  48.         name = 'glorious'
  49.         current_mystery = glorious_mysteries[n]
  50.     elif mystery == JOYFUL:
  51.         name = 'joyful'
  52.         current_mystery = joyful_mysteries[n]
  53.     elif mystery == SORROWFUL:
  54.         name = 'sorrowful'
  55.         current_mystery = sorrowful_mysteries[n]
  56.     elif mystery == LUMINOUS:
  57.         name = 'luminous'
  58.         current_mystery = luminous_mysteries[n]
  59.  
  60.     print 'The ' + nth(n + 1) + ' ' + name + ' mystery is ' + current_mystery
  61.  
  62.  
  63. def nth(n):
  64.     if n == 1:
  65.         return str(n) + 'st'
  66.     elif n == 2:
  67.         return str(n) + 'nd'
  68.     elif n == 3:
  69.         return str(n) + 'rd'
  70.     else:
  71.         return str(n) + 'th'
  72.  
  73.  
  74. def pray_rosary(num_times=1):
  75.     NUM_MYSTERIES = 5
  76.  
  77.     for i in xrange(num_times):
  78.         print '\nRosary #' + str(i + 1) + '\n'
  79.  
  80.         sign_of_the_cross()
  81.         apostles_creed()
  82.         #if i == num_times - 1:
  83.             #pause = raw_input()
  84.  
  85.         print ''
  86.         our_father()
  87.         print ''
  88.         hail_mary(3)
  89.         print ''
  90.         glory_be()
  91.  
  92.         for j in xrange(NUM_MYSTERIES):
  93.             print ''
  94.             mystery(j)
  95.             print ''
  96.             our_father()
  97.             print ''
  98.             hail_mary(10)
  99.             #pause = raw_input()
  100.             print ''
  101.             glory_be()
  102.             print ''
  103.             o_my_jesus()
  104.             print ''
  105.  
  106.         print ''
  107.         hail_holy_queen()
  108.  
  109.  
  110. def print_lines(lines):
  111.     for i in lines:
  112.         print i
  113.  
  114.  
  115. def sign_of_the_cross(num_times=1):
  116.     for i in xrange(num_times):
  117.         print ''
  118.         print '*sign*'
  119.         print 'In the name of the father, and of the son, and of the holy spirit. Amen.'
  120.         print ''
  121.  
  122.  
  123. def get_lines(file_name):
  124.     text = open(file_name, 'r')
  125.     lines = []
  126.  
  127.     for line in text:
  128.         line = line.replace('\n', '')
  129.         lines.append(line)
  130.  
  131.     text.close()
  132.  
  133.     return lines
  134.  
  135.  
  136. def apostles_creed(num_times=1):
  137.     lines = get_lines('ApostlesCreed.txt')
  138.  
  139.     for i in xrange(num_times):
  140.         print ''
  141.         print_lines(lines)
  142.         print ''
  143.  
  144.  
  145. def our_father(num_times=1):
  146.     lines = get_lines('OurFather.txt')
  147.  
  148.     for i in xrange(num_times):
  149.         print ''
  150.         print_lines(lines)
  151.         print ''
  152.  
  153.  
  154. def hail_mary(num_times=1):
  155.     lines = get_lines('HailMary.txt')
  156.  
  157.     for i in xrange(num_times):
  158.         print ''
  159.         print_lines(lines)
  160.         print ''
  161.  
  162.  
  163. def glory_be(num_times=1):
  164.     lines = get_lines('GloryBe.txt')
  165.  
  166.     for i in xrange(num_times):
  167.         print ''
  168.         print_lines(lines)
  169.         print ''
  170.  
  171.  
  172. def o_my_jesus(num_times=1):
  173.     lines = get_lines('OMyJesus.txt')
  174.  
  175.     for i in xrange(num_times):
  176.         print ''
  177.         print_lines(lines)
  178.         print ''
  179.  
  180.  
  181. def hail_holy_queen(num_times=1):
  182.     lines = get_lines('HailHolyQueen.txt')
  183.  
  184.     for i in xrange(num_times):
  185.         print ''
  186.         print_lines(lines)
  187.         print ''
  188.  
  189.  
  190. print 'Rosary Automator'
  191. print '----------------'
  192.  
  193. num_rosaries = input('\nHow many rosaries would you like to pray?:\t')
  194.  
  195. pray_rosary(num_rosaries)
  196.  
  197.  
  198. pause = raw_input('\n\nPrayer/s finished. Press ENTER to exit.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement