Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from appJar import gui
- import time as t
- app = gui('Debate Assistant')
- def committee(x):
- print("ran 'committee'")
- global committee
- is_committee = True
- app.removeAllWidgets()
- app.addLabelOptionBox('committee component', ['Senate Committee', 'House Committee'])
- app.setLabel('committee component', 'Is this a House or Senate committee?')
- app.addLabelOptionBox('committee number', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13'])
- app.setLabel('committee number', 'Select your committee number')
- app.addButton('committee debate', next_committee)
- app.setButton('committee debate', 'Next')
- print(is_committee)
- def next_committee(x):
- print("ran 'next_committee'")
- global committee_number
- global committee_component
- committee_number = app.getOptionBox('committee number')
- committee_component = app.getOptionBox('committee component')
- print(committee_component, committee_number)
- committee_debate(None)
- def committee_debate(x):
- print("ran 'Committee debate'")
- app.removeAllWidgets()
- app.addLabelOptionBox('committee bills', bills[int(committee_number) - 1])
- app.setLabel('committee bills', 'Bill:')
- app.addButton('next committee debate', next_committee_debate)
- app.setButton('next committee debate', 'Next')
- def next_committee_debate(x):
- global current_bill
- print("ran 'next_committee_debate'")
- current_bill = app.getOptionBox('committee bills')
- introduction_bill(x)
- def introduction_bill(x):
- global time_remaining, time_allotted
- time_remaining = 120
- time_allotted = 120
- app.removeAllWidgets()
- print("ran 'introduction_bill'")
- app.addLabel('timer', 'Time remaining: 2:00')
- app.addButtons(['start timer','update'], [start_timer, update_timer])
- app.addButton('next introduction', next_introduction)
- def next_introduction(x):
- print("ran'next_introduction'")
- def update_timer():
- global time_remaining, current_function
- current_function = 'update timer'
- time_remaining = end_time - t.time()
- minutes = int(time_remaining // 60)
- seconds = round(time_remaining % 60, 2)
- app.setLabel('timer', 'Timer remaining: ' + str(minutes) + ':' + str(seconds))
- print("ran 'update_timer'")
- if time_remaining > -10:
- app.registerEvent(update_timer)
- def start_timer(x):
- print("ran 'start_timer'")
- global start_time, end_time
- start_time = t.time()
- end_time = start_time + time_allotted
- update_timer()
- def ga(a):
- print("ran 'General Assembly'")
- bills = [['BSB/18-1-1', 'BSB/18-1-2', 'RSB/18-1-3', 'BSB/18-1-4'],
- ['BSB/18-2-1', 'BSB/18-2-2', 'RSB/18-2-3', 'BSB/18-2-4']]
- is_committee = False
- committee_component = None
- committee_number = None
- current_bill = None
- start_time = 0
- end_time = 0
- time_remaining = 0
- current_function = None
- general_assembly = False
- time_allotted = 120
- app.addLabel('timer', '')
- app.addLabel('welcome', 'Welcome to the Debate Assistant!')
- app.addLabel('com or ga', 'Please select if you are in committee or General Assembly')
- app.addButtons(['Committee', 'General Assembly'], [committee, ga])
- app.go()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement