upload.py (cont) def update_cvs(): """update the cvs in the current directory""" run_command("cvs up -P -d") def get_changed_files(): """get from the ChangeLog the names of changed files""" f = open("ChangeLog", "r"); # will throw an exception if fails lines = f.readlines() # can't use xreadlines() due to len(). f.close(); r_header = re.compile("") r_fname = re.compile("\s+\*\s*(\S+):") # lines with file names i = 0 fnames = ["ChangeLog"] while (i < len(lines)): if (r_header.search(lines[i]) == None): i = i + 1; #search until you find the first entry continue else: # whee, match found, let's start to the beginning of the entry i = i + 2; break # we're in the ChangeLog entry now while (i < len(lines)): if (r_header.search(lines[i]) == None): m = r_fname.search(lines[i]); if (m != None): fname = m.group(1) print "%d: got file name: '%s'" % (i, fname) fnames.append(fname) i = i + 1 else: # we found another header line, get out break return fnames