-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyyyc_v17.py
90 lines (70 loc) · 2.81 KB
/
pyyyc_v17.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import properties
class PyYYCPresentation(properties.PropertyClass):
""" class PyYYCPresentation
This class contains info about basic presentations at the
PyYYC meetup. It generates some really useful summary info
about the presentation.
"""
presenter = properties.String('Name of presenter')
topic = properties.String('Topic of presentation')
time_limit = properties.Float('Time limit in minutes')
nslides = properties.Int('Number of powerpoint slides')
slide_color = properties.Color('Color of the slides')
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"""
return(any([rgb > 200 for rgb in self.slide_color]) and
any([rgb < 50 for rgb in self.slide_color]))
class YYCjsPresentation(WithSpecialProps):
""" class YYCjsPresentation
This class contains info about basic presentations at the
YYCjs meetup. It generates some really useful summary info
about the presentation.
"""
presenter = properties.String('Name of presenter')
topic = properties.String('Topic of presentation')
time_limit = properties.Float('Time limit in minutes')
nslides = properties.Int('Number of powerpoint slides')
slide_color = properties.Color('Color of the slides')
def summarize(self):
"""Print a short description of the presentation. Useful for
press junkets.
"""
print('JavaScripter {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"""
return False
class FreeSpiritPresentation(WithSpecialProps):
""" class FreeSpiritPresentation
This class contains info about basic free-spirit presentations
"""
presenter = properties.String('Name of presenter')
favorite_color = properties.Color('Favorite color of presenter')
def summarize(self):
"""Print a short description of the presentation. Useful for
press junkets.
"""
print('{name} loves {topic}.'.format(
name=self.presenter,
topic=self.favorite_color
))