<s> import os <EOL> import shutil <EOL> import shakespeare . index <EOL> ourindex = shakespeare . index . all <EOL> store = '<STR_LIT>' <EOL> if not os . path . exists ( store ) : <EOL> os . makedirs ( store ) <EOL> meta_path = os . path . join ( store , '<STR_LIT>' ) <EOL> from ConfigParser import SafeConfigParser <EOL> cfp = SafeConfigParser ( ) <EOL> cfp . read ( meta_path ) <EOL> for row in ourindex : <EOL> if not '<STR_LIT>' in row . name : <EOL> path = row . get_cache_path ( format = '<STR_LIT>' ) <EOL> name = row . name <EOL> newpath = os . path . join ( store , name + '<STR_LIT>' ) <EOL> print '<STR_LIT>' % ( path , newpath ) <EOL> src = file ( path ) <EOL> dest = file ( newpath , '<STR_LIT:w>' ) <EOL> dest . write ( src . read ( ) ) <EOL> dest . close ( ) <EOL> src . close ( ) <EOL> if not cfp . has_section ( name ) : <EOL> cfp . add_section ( name ) <EOL> cfp . set ( name , '<STR_LIT:title>' , row . title ) <EOL> cfp . set ( name , '<STR_LIT>' , row . notes ) <EOL> cfp . set ( name , '<STR_LIT>' , '<STR_LIT>' ) <EOL> cfp . set ( name , '<STR_LIT>' , row . creator ) <EOL> cfp . set ( name , '<STR_LIT:url>' , row . url ) <EOL> cfp . write ( file ( meta_path , '<STR_LIT:w>' ) ) </s>
