Esempio n. 1
0
	def initial_jobs(self):
		while True:
			json_str=self.json_file.readline()
			if not json_str:
				break
			elif not json_str.startswith("{"):
				continue
			else:
				json_dict = json.loads(json_str)
				event = Event(json_dict)
				event.process_event(self.job)

		return 1
Esempio n. 2
0
from study import Study
from atmosphere import Athomosphere
from assignment import Assignment
import random

coffee_input = input('"Are we out of coffee?" - giving a meany look to Humen: ')
CodecoolClass.coffee_status = True if coffee_input == "n" else False
codecool_bp = CodecoolClass.generate_local()
codecool_bp.sum_stats("morning")
input("")
print("A typical day @Codecool starts with a mentors' discussion about that week's assignment.")
input("")
# event mentor discussion
for i in codecool_bp.mentors:
    event = Event(random.randint(-3, 4), "{0} is attending the meeting. Energy level: ".format(i.full_name))
    i.process(event.process_event())
codecool_bp.drink_coffee(50)
input("")
print("One of the mentors gets appointed to be responsible for the week's project: ")
# event "This week ..... mentor got appointed. Hooraaay!"
# appointing mentor of the week
codecool_bp.appoint_mentor()
active_mentor = next(i for i in codecool_bp.mentors if i.responsible)
input("")
print('''It's 8.40 and the office is almost empty.
Oh, wait, I can see someone drinking their morning coffee in the kitchen.
The students start to arrive very very slowly. Soothing music is playing in the background.''')
input("")
print("9 o'clock - GONG!")
input("")
print("Who's here already? Let's check the attendance!")