Package TalkManagement :: Module Talks
[show private | hide private]
[frames | no frames]

Module TalkManagement.Talks

Module for the two main Talk management classes: TalkManagement.Talks.Talk and TalkManagement.Talks.FactoredTalks. The two classes share the main methods for display, namely TalkManagement.Talks.Talk.toHTML and TalkManagement.Talks.Talk.toText.

For a better maintainability, two functions have been separated into different classes: TalkManagement.Talks.Person and TalkManagement.Talks.Event. In a way, they should be private, because they are really used only inside... but one may never know, maybe they might become useful per se at some point.

Ivan Herman
Classes
Event Separate class for an Event, just to make things a bit easier to manage
FactoredTalks Factored talks are a group of talks that happen on the same event.
Person Separate class for a Person (presenter), just to make things a bit easier to manage.
Talk See also the introductory comments for details.
_phonyNode A real hack.

Exceptions
dataError data Error (Exeption).

Function Summary
datetime.date getDate(dateR)
Return a python date from the literal in the resource
  sanitizeDate(date, format)
A stupid utility, really.
  _aOrAn(string)
When generating a text, a decision has to be made whether 'a' or 'an' is used...
  _getTeamFakeHome(mbox)
Generate a fake home page reference for the team; used if there is no /People/ page present in the database.
  _org(p, org, url)
Add the name of an organization, enclosed in a <a> if there is a valid URL.
  _textWithLanguage(parent, text, lang)
Just a small helper function to generate a Text DOM Node with a language info if necessary with a text.
  _theOrNotThe(parent, description)
Whether the word 'the' should be added as a text DOM Node.

Variable Summary
URIRef activity = u'http://www.w3.org/2001/04/roadmap/org#Activ...
URIRef Cgroup = u'http://www.w3.org/2001/04/roadmap/org#Coordin...
str consonants = 'aeuioAEUIO'
URIRef Igroup = u'http://www.w3.org/2001/04/roadmap/org#Interes...
Namespace ns_actmenu = u'http://www.w3.org/2004/08/TalkManagement#...
Namespace ns_contact = u'http://www.w3.org/2000/10/swap/pim/contac...
Namespace ns_foaf = u'http://xmlns.com/foaf/0.1/'
Namespace ns_ical = u'http://www.w3.org/2002/12/cal/ical#'
Namespace ns_office = u'http://www.w3.org/Consortium/Offices/Offic...
Namespace ns_org = u'http://www.w3.org/2001/04/roadmap/org#'
Namespace ns_talk = u'http://www.w3.org/2004/08/Presentations.owl#...
Namespace ns_vcard = u'http://www.w3.org/2001/vcard-rdf/3.0#'
URIRef office = u'http://www.w3.org/Consortium/Offices/Offices....
int OFFICE_STAFF = 2                                                                     
int OTHER = 3                                                                     
int TEAM = 0                                                                     
int WG_CHAIR = 1                                                                     
URIRef Wgroup = u'http://www.w3.org/2001/04/roadmap/org#Working...
list _noTitle = ['booth', 'lunchtime talk']
timedelta _oneDay = datetime.timedelta(1)
list _replace = [(' 01', ' 1'), (' 02', ' 2'), (' 03', ' 3'),...

Function Details

getDate(dateR)

Return a python date from the literal in the resource
Parameters:
dateR - data in ISO string format, ie, YY-MM-DD
Returns:
date in Python
           (type=datetime.date)

sanitizeDate(date, format)

A stupid utility, really. The default date.strftime routine of the python library cannot generate a date without a leading zero. Ie, it always generates '02 February' rather than '2 February'. So this here is a routine wrapping around strftime... This routine is based on a pattern " 0X" (note the space) to avoid turning 2004 into 204...
Parameters:
date - a date object
format - a format string, to be used fir date.strftime
Returns:
a sanitized date string with leading zeros stripped off if necessary

_aOrAn(string)

When generating a text, a decision has to be made whether 'a' or 'an' is used...
Parameters:
string - the string to be examined
Returns:
the string preceded by 'a' or 'an', according to the proper English rule

_getTeamFakeHome(mbox)

Generate a fake home page reference for the team; used if there is no /People/ page present in the database. The fake home page is http://www.w3.org/People/all?pictures=yes#emailaddress.
Parameters:
mbox - email URI (ie, mailbox:XXX)
Returns:

http://www.w3.org/People/all?pictures=yes#emailaddress

_org(p, org, url)

Add the name of an organization, enclosed in a <a> if there is a valid URL.
Parameters:
p - a DOM Node
           (type=PyXMLUtils.ElementNode)
org - name of an organization (may also be an RDF resource)
url - URL or None.

_textWithLanguage(parent, text, lang=None)

Just a small helper function to generate a Text DOM Node with a language info if necessary with a text.
Parameters:
parent - a DOM Node
           (type=PyXMLUtils.ElementNode)
text - the text to be added to the 'parent'
lang - the language tag

_theOrNotThe(parent, description)

Whether the word 'the' should be added as a text DOM Node. This should not happen if the text afterwards already begins with 'The' or 'the'. If necessary, the Text Node with content 'the' is added to the parent.
Parameters:
parent - a DOM Node
           (type=PyXMLUtils.ElementNode)
description - the text to be be checked
           (type=string)

Variable Details

activity

Type:
URIRef
Value:
u'http://www.w3.org/2001/04/roadmap/org#Activity'                      

Cgroup

Type:
URIRef
Value:
u'http://www.w3.org/2001/04/roadmap/org#CoordinationGroup'             

consonants

Type:
str
Value:
'aeuioAEUIO'                                                           

Igroup

Type:
URIRef
Value:
u'http://www.w3.org/2001/04/roadmap/org#InterestGroup'                 

ns_actmenu

Type:
Namespace
Value:
u'http://www.w3.org/2004/08/TalkManagement#'                           

ns_contact

Type:
Namespace
Value:
u'http://www.w3.org/2000/10/swap/pim/contact#'                         

ns_foaf

Type:
Namespace
Value:
u'http://xmlns.com/foaf/0.1/'                                          

ns_ical

Type:
Namespace
Value:
u'http://www.w3.org/2002/12/cal/ical#'                                 

ns_office

Type:
Namespace
Value:
u'http://www.w3.org/Consortium/Offices/Offices.rdf#'                   

ns_org

Type:
Namespace
Value:
u'http://www.w3.org/2001/04/roadmap/org#'                              

ns_talk

Type:
Namespace
Value:
u'http://www.w3.org/2004/08/Presentations.owl#'                        

ns_vcard

Type:
Namespace
Value:
u'http://www.w3.org/2001/vcard-rdf/3.0#'                               

office

Type:
URIRef
Value:
u'http://www.w3.org/Consortium/Offices/Offices.rdf#Office'             

OFFICE_STAFF

Type:
int
Value:
2                                                                     

OTHER

Type:
int
Value:
3                                                                     

TEAM

Type:
int
Value:
0                                                                     

WG_CHAIR

Type:
int
Value:
1                                                                     

Wgroup

Type:
URIRef
Value:
u'http://www.w3.org/2001/04/roadmap/org#WorkingGroup'                  

_noTitle

Type:
list
Value:
['booth', 'lunchtime talk']                                            

_oneDay

Type:
timedelta
Value:
datetime.timedelta(1)                                                  

_replace

Type:
list
Value:
[(' 01', ' 1'),
 (' 02', ' 2'),
 (' 03', ' 3'),
 (' 04', ' 4'),
 (' 05', ' 5'),
 (' 06', ' 6'),
 (' 07', ' 7'),
 (' 08', ' 8'),
...                                                                    

Generated by Epydoc 2.1 on Sat Aug 06 12:38:27 2005 http://epydoc.sf.net