<s> """<STR_LIT>""" <EOL> import yaki . Engine , yaki . Store <EOL> from yaki . Utils import * <EOL> from BeautifulSoup import * <EOL> import re , urlparse <EOL> template = """<STR_LIT>""" <EOL> class FlashMovieWikiPlugin ( yaki . Plugins . WikiPlugin ) : <EOL> def __init__ ( self , registry , webapp ) : <EOL> self . ac = webapp . getContext ( ) <EOL> registry . register ( '<STR_LIT>' , self , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def run ( self , serial , tag , tagname , pagename , soup , request , response ) : <EOL> try : <EOL> src = tag [ '<STR_LIT:src>' ] <EOL> width = tag [ '<STR_LIT:width>' ] <EOL> height = tag [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> return True <EOL> ( schema , netloc , path , parameters , query , fragment ) = urlparse . urlparse ( src ) <EOL> if schema . lower ( ) in ATTACHMENT_SCHEMAS or self . ac . store . isAttachment ( pagename , path ) : <EOL> src = self . ac . media + pagename + "<STR_LIT:/>" + path <EOL> tag . replaceWith ( template % ( serial , serial , src , width , height ) ) <EOL> return False <EOL> return True </s>
