-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyyyc_v00.py
48 lines (40 loc) · 1.54 KB
/
pyyyc_v00.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
class PyYYCPresentation(object):
""" class PyYYCPresentation
This class contains info about basic presentations at the
PyYYC meetup. It generates some really useful summary info
about the presentation.
Inputs:
presenter - Name of the presenter
topic - Brief explanation of the topic
time_limit - Time limit of the presentation
nslides - Number of slides (because all presentations
have slides!)
slide_color - RGB color of all the slides
"""
def __init__(self, presenter, topic, time_limit, nslides, slide_color):
self.presenter = presenter
self.topic = topic
self.time_limit = time_limit
self.nslides = nslides
self.slide_color = slide_color
def summarize(self):
"""Print a short description of the presentation. Useful for
press junkets.
"""
print('Pythonista {name} talking about {topic}.'.format(
name=self.presenter,
topic=self.topic
))
def time_per_slide(self):
"""Time available for each slide"""
return self.time_limit / self.nslides
def strains_eyes(self):
"""Determines if the slides will cause eye strain based on their
color
"""
return(any([rgb > 200 for rgb in self.slide_color]) and
any([rgb < 50 for rgb in self.slide_color]))