Sharedwww / msri07 / a.sageOpen in CoCalc
Author: William A. Stein
1
class Speaker:
2
def __init__(self, name, employer=None, url=None, email=None, status=None, title=None, abstract=None):
3
self.name = name
4
self.employer = employer,
5
self.email = email
6
self.url = url
7
self.title = title
8
self.abstract = abstract
9
self.status = status
10
if status != 'invited' and status != 'contributed':
11
raise ValueError, '%s: "%s"'%(name, status)
12
13
def __repr__(self):
14
return self.name
15
16
def last_name(self):
17
name = self.name
18
if ' and ' in self.name:
19
name = self.name.split(' and ')[0]
20
return ' '.join(name.split()[1:])
21
22
def first_name(self):
23
return self.name.split()[0]
24
25
def __cmp__(self, right):
26
return cmp(self.last_name(), right.last_name())
27
28
def tag(self):
29
return self.name.replace(' ','')
30
31
def html_full(self):
32
return """
33
<a name="%s">
34
<b>%s</b>:
35
<i>%s</i><br>
36
%s"""%(
37
self.tag(), self.html_name(), self.html_title(), self.abstract)
38