Tao of the MachineProgramming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.
Last 10 archives
:: About me
:: Oasis Digital
Some progress...Some more refactoring. There is now a HTMLWriter, which should have been there all along. It deals with writing HTML, obviously, while HTMLMaker can now focus on generating it, and nothing else. Much better. Surprisingly, after the refactoring, the new code worked right out of the box. :-)
Now all I need to do is come up with a sensible and clean way to set blog's and entry's attributes. And then 0.8 may finally see the light...
Stunning stuffRead these articles... for example, this one about cyberlife. With a few simple (?) examples, the guy delves not only into artificial life, but also philosophical musings. An example:
All I ask you to do is remember some episode from your childhood. Muse on it for a moment and relive it; then ask yourself, how come you believe you experienced those events at all? After all, you weren't there at the time! Probably not a single atom that's in your body now was there then. You still consider yourself to be the same person, yet you've been replaced many times over - you're not even the same shape as you were then.or
The first time I watched a "glider" move across the screen in a computer simulation of Conway's Game of Life and realized that something was moving and yet no thing was moving.Hmm... food for thought... hey, I am only an amateur philosopher... :-)
Custom pages...just got a little bit better. Or rather, the blog object grew a new attribute archives, a list of tuples (pagename, ids). Obviously, this is for easy association of generated page names with entry ids, and a new method blog.get_permalink uses this. This allows for using permalinks in custom pages. For example, here's a list of all entries.
Important: The blog.arch_page_names attribute has become obsolete and has been removed. If you're using this, change your templates or embedded code.
The new attribute is easy to use:
for pagename, ids in blog.archives: # do stuffor generate a permalink:
blog.get_permalink(entry.blogentry_id)More API improvements will be added if necessary. And then I can write some solid documentation...
Shortcuts, macros, embedded code, oh my!Yesterday I received a patch from Howard Hansen, with the implementation of a good idea: simple shortcuts, which are apparently like those used by Radio. They look like this: "shortcut", where the text 'shortcut' can be replaced with a certain text, or even evaluated.
I enthusiastically proceeded to apply the patch. However, then I realized something. Anything these shortcuts do, can be done by embedded code as well; only the enclosing characters look different (<% %> rather than " ").
For example, my globals.py contains this line:
awaretek = '<a href="http://www.awaretek.com/">awaretek</a>'Now, if I include the embedded code <% awaretek %> anywhere in my post, then this is evaluated and replaced by the HTML. See? Awaretek
I don't see the need for another special case if embedded code can work just fine. Aside from that, the patch was good, and much appreciated. This form of shortcuts will be available in 0.7.3 and therefore in the next release (probably 0.8).