if dates[i][-3:].lower() in ("nov","dec"): dates[i]+=' ' + str(year) if dates[i][-3:].lower() in ("jan","feb"): dates[i]+=' ' + str(year+1) if dates[i]: dates[i] = time.strftime('%Y-%m-%d', time.strptime(dates[i], "%d %b %Y")) elif colname in ('pantomime','production'): # If part of it is bold, that's the title. if colsoup.b: title = extractText(colsoup.b) colsoup.b.extract() # If there is an image, that's the title. elif colPictures: titleImg = colPictures.pop(0) title = getTitleOfImage(titleImg) if not title: title = "!!ERROR !! %s" % titleImg missingImgs.add(titleImg) else: title = extractText(colsoup) description += extractText(colsoup) elif colname in ('starring','cast details'): castText = extractText(colsoup) # Split the cast into a list of people if "; " in castText: cast = [i.strip() for i in castText.split("; ")] elif ", " in castText:
#!/usr/bin/env python # vim: set fileencoding=UTF-8 : from imageList import imageList, getTitleOfImage from operator import itemgetter from plays import plays print """<html> <head> <title>Image title test</title> <style> div { height: 250px; width: 290px; text-align: center; float: left } </style> </head> <body> """ uniquePlays = list(set([(play["title"], play["titleImg"]) for play in plays if play["titleImg"]])) uniquePlays.sort() # for url,title in imageList.items(): for title, url in uniquePlays: print '<div><img src="http://www.its-behind-you.com/%s" /><br />%s<br />%s</div>' % (url, url, getTitleOfImage(url)) print """</body> </html>"""