Re: discordia plug in
will <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
That's the coolest thing EVER! Hot dogs and buns for everyone! /will On Wed, 26 Feb 2003, Lee Joramo wrote: > > Okay, I got my "Hello World" plug in working. In playing with this, I > found that the plug ins can be far simpler than I originally thought. > > So from there I have created a plugin to provide the Discordia date. > Pretty useless, but that is the point. > > Lee Joramo > > > ---discordia.py--START--- > def getDiscordia(): > import time > zeit = time.localtime(time.time()) > daynum = zeit[-2] #Day of year > year = zeit[0] #for St. Tibb's Day logic > dyear = year + 1166 > #Gregorian Calendar rules for leap year > if year % 400 == 0: > tibs = 1 > elif not (year % 100 == 0) and (year % 4 == 0): > tibs = 1 > else: > tibs = 0 > if tibs and daynum == 60: > day = "St. Tib's Day, 59 1/2 of Chaos, %s" % dyear > return day > if tibs and daynum > 60: > daynum -= 1 > # St. Tib's Day exists seperate from the rest of the calendar > # --- Apparently, it's in somebody's freezer or something. > #daynum%5 == 0 means that it's the fifth day; no day zero. > dayname = ( > 'Setting Orange','Sweetmorn', 'Boomtime', > 'Pungenday', 'Prickle-Prickle')[(daynum) % 5] > daynumber = ((daynum - 1) % 73) + 1 > season = ( > 'Chaos', 'Discord', 'Confusion', > 'Bureaucracy', 'The Aftermath')[(daynum-1) / 73] > return "%s, %d of %s, %s" % (dayname, daynumber, season, dyear) > > def load(py, entryList): > py["discordia"] = getDiscordia() > ---discordia.py--END--- > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Scholarships for Techies! > Can't afford IT training? All 2003 ictp students receive scholarships. > Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. > www.ictp.com/training/sourceforge.asp > _______________________________________________ > pyblosxom-users mailing list > pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/pyblosxom-users > -- whatever it is, you can find it at http://www.bluesock.org/~willg/ except Will--you can only see him in real life. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf