Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #/home/clockworkpc/bin/casetagcreator.py
- # Released under a GPLv3 Licence by Clockwork PC 2012
- # www.clockworkpc.com.au
- # You are entitled to the following four freedoms:
- # Freedom 0: To run this program for any purpose
- # Freedom 1: To study how this program works and change it to make it do what you wish
- # Freedom 2: To redistribute copies so you can help your neighbour
- # Freedom 3: To distribute copies of your modified version to others
- import os
- masterCaseFile = (os.getenv("HOME")+"/Dropbox/Deakin/Tiddlywiki/TiddlyTags/MasterFiles/master_tiddlycases.txt")
- os.system("touch " + masterCaseFile)
- def caseTagGenerator():
- print ""
- caseParty1 = raw_input("Enter the name of the first party: ")
- print ""
- caseParty2 = raw_input("Enter the name of the second party: ")
- print ""
- caseYear = raw_input("Enter the year only (no brackets): ")
- print ""
- caseYearQ = raw_input("""
- Which brackets?
- 1. Round brackets?
- 2. Square brackets?
- Enter your selection: """)
- print ""
- caseCitation = raw_input("Enter the case citation: ")
- print ""
- caseParagraph = raw_input("Enter the case paragraph, number only: ")
- print ""
- caseJudge = raw_input("Enter the name of the judge or justice, e.g. Kirby J or Kirby and Hughes JJ: ")
- if caseParagraph == "":
- if caseYearQ == "1":
- tiddlyCase = "[[" + caseParty1 + " v " + caseParty2 + " (" + caseYear + ") " + caseCitation + "]]"
- elif caseYearQ == "2":
- tiddlyCase = "[[" + caseParty1 + " v " + caseParty2 + " [" + caseYear + "] " + caseCitation + "]]"
- elif caseJudge == "":
- if caseYearQ == "1":
- tiddlyCase = "[[" + caseParty1 + " v " + caseParty2 + " (" + caseYear + ") " + caseCitation + "]] at " + caseParagraph
- elif caseYearQ == "2":
- tiddlyCase = "[[" + caseParty1 + " v " + caseParty2 + " [" + caseYear + "] " + caseCitation + "]] at " + caseParagraph
- else:
- if caseYearQ == "1":
- tiddlyCase = "[[" + caseParty1 + " v " + caseParty2 + " (" + caseYear + ") " + caseCitation + "]] at " + caseParagraph + " per " + caseJudge
- elif caseYearQ == "2":
- tiddlyCase = "[[" + caseParty1 + " v " + caseParty2 + " [" + caseYear + "] " + caseCitation + "]] at " + caseParagraph + " per " + caseJudge
- print tiddlyCase
- f = open(masterCaseFile, "a")
- f.write(tiddlyCase+'\n')
- f.close()
- xCowsayLine = "xcowsay --time=1 " + "'" + tiddlyCase + "'"
- print xCowsayLine
- os.system(xCowsayLine)
- def newCaseTest():
- newCaseQ = raw_input("""
- Do you want to add another case?
- 1. Yes
- 2. No
- Enter your selection: """)
- running = True
- while running:
- caseTagGenerator()
- newCaseQ = int(raw_input("""
- Do you want to add another case?
- 1. Yes
- 2. No
- Enter your selection: """))
- if newCaseQ == 2:
- running = False
- os.system("xcowsay 'Alright then, goodbye'")
- elif newCaseQ == 1:
- os.system('clear')
- else:
- os.system('clear')
- print """
- I'm not sure what you want, but let's add another case!
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement