Codeviewer plugin test
Back a few years ago, I used a code syntax highlighter called Code Viewer that was created by Aaron Schaefer at Elastic Dog. That has since been taken over by HÃ¥kan Carlström. I spent too many hours this weekend getting this plugin setup to parse Python source code. It uses GeSHi to highlight the code syntax, and I had to hack up the GeSHi CSS and my own CSS to get the Python source code to look like I wanted, but it’s about there. I highly recommend this plugin if you are looking to highlight source code of virtually any modern language. The coolest part of it is that it links to a source code file and you just point to that file, you don’t have to include the code in the post. Below is a sampling of the output, with my own CSS styling applied.
def grabNewImages( self ):""" Recurses thru directories and looks for images to upload. I only want to upload my '5-star' images, so we scan the IPTC tags for 'r5', my way of tagging my pics I really like (usually get prints of r5s) """images = []for dirpath, dirnames, filenames in os.walk(IMAGE_DIR):for f in filenames :# Grab IPTC keywordsinfo = IPTCInfo(os.path.join(dirpath, f))# Is it a 5-star photo?if 'r5' in info.keywords:print 'File to upload:',os.path.join(dirpath, f)ext = f.lower().split('.')[-1]if ( ext == 'jpg' or ext == 'gif' or ext == 'png' ):images.append( os.path.normpath( dirpath + '/' + f ) )images.sort()return images- Download this code: test.txt


