 import codecs <EOL> from scrapy . exceptions import NotConfigured <EOL> from frontera . contrib . scrapy . middlewares . seeds import SeedLoader <EOL> class FileSeedLoader ( SeedLoader ) : <EOL> def configure ( self , settings ) : 
 self . seeds_source = settings . get ( '<STR_LIT>' ) 
 import codecs <EOL> from scrapy . exceptions import NotConfigured <EOL> from frontera . contrib . scrapy . middlewares . seeds import SeedLoader <EOL> class FileSeedLoader ( SeedLoader ) : <EOL> def configure ( self , settings ) : <EOL> self . seeds_source = settings . get ( '<STR_LIT>' ) <EOL> if not self . seeds_source : <EOL> raise NotConfigured <EOL> def load_seeds ( self ) : <EOL> return self . load_seeds_from_file ( self . seeds_source ) <EOL> def load_seeds_from_file ( self , file_path ) : <EOL> with codecs . open ( file_path , '<STR_LIT>' ) as f : <EOL> return self . load_seeds_from_data ( ( f ) ) <EOL> def load_seeds_from_data ( self , data ) : <EOL> seeds = [ ] <EOL> for seed in data : <EOL> clean_seed = self . clean_seed ( seed ) <EOL> if clean_seed : <EOL> seeds . append ( clean_seed ) <EOL> return seeds <EOL> def clean_seed ( self , url ) : <EOL> return url . strip ( '<STR_LIT>' ) </s>
