Created
June 2, 2009 17:30
-
-
Save deontologician/122380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_list = blobs_from_db | |
interested_in_formatting_posts = some_list1 | |
interested_in_formatting_the_page = some_list2 | |
# when modules are loaded they add methods to whatever "interest" lists they want | |
def format_posts(): | |
for element in post_list: # list of text blobs from database | |
for formatter in interested_in_posts: | |
element = formatter(element) | |
def format_page(): | |
formatted_posts = "\n".join(post_list) | |
page = standard_header + formatted_posts + standard_footer | |
for formatter in interested_in_formatting_page: | |
page = formatter(page) | |
def display(): | |
#cherrypy code to display page we have constructed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment