def process_revision_date(revision_info): # split revision number from data for line in revision_info.split('\n'): if line.startswith('Last Changed Date:'): break fields = line.split(':') msg = 'Keyword "Last Changed Date" was not found anywhere in text: %s' % revision_info assert fields[0].startswith('Last Changed Date'), msg revision_date = ''.join(fields[1:]) return revision_date
def process_revision_info(revision_info): # split revision number from data for line in revision_info.split('\n'): if line.startswith('Revision:'): break fields = line.split(':') msg = 'Keyword "Revision" was not found anywhere in text: %s' % revision_info assert fields[0].startswith('Revision'), msg try: revision_number = int(fields[1]) except: msg = ("Revision number must be an integer. I got '%s'.\n" 'Check that the command svn is on the system path.' % fields[1]) raise Exception, msg return revision_number