<s> import os . path <EOL> import subprocess <EOL> import yaml <EOL> def find_modified_deliverable_files ( reporoot ) : <EOL> "<STR_LIT>" <EOL> results = subprocess . check_output ( <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = reporoot , <EOL> ) <EOL> filenames = [ <EOL> l . strip ( ) <EOL> for l in results . splitlines ( ) <EOL> if l . startswith ( '<STR_LIT>' ) <EOL> ] <EOL> return filenames <EOL> def get_modified_deliverable_file_content ( reporoot , filenames ) : <EOL> """<STR_LIT>""" <EOL> deliverable_files = filenames <EOL> if not deliverable_files : <EOL> deliverable_files = find_modified_deliverable_files ( <EOL> reporoot <EOL> ) <EOL> for basename in deliverable_files : <EOL> filename = os . path . join ( reporoot , basename ) <EOL> with open ( filename , '<STR_LIT:r>' ) as f : <EOL> deliverable_data = yaml . load ( f . read ( ) ) <EOL> send_announcements_to = deliverable_data . get ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> series_name = os . path . basename ( <EOL> os . path . dirname ( os . path . abspath ( filename ) ) <EOL> ) <EOL> deliverable_name = os . path . splitext ( os . path . basename ( filename ) ) [ <NUM_LIT:0> ] <EOL> all_versions = { <EOL> rel [ '<STR_LIT:version>' ] : rel for rel in deliverable_data [ '<STR_LIT>' ] <EOL> } <EOL> version = deliverable_data [ '<STR_LIT>' ] [ - <NUM_LIT:1> ] [ '<STR_LIT:version>' ] <EOL> this_version = all_versions [ version ] <EOL> for project in this_version [ '<STR_LIT>' ] : <EOL> yield ( deliverable_name , series_name , version , <EOL> project [ '<STR_LIT>' ] , project [ '<STR_LIT>' ] , <EOL> send_announcements_to ) </s>
