- if not args.resume_from in allProjects:
- raise Exception("Project %s does not exist" % args.resume_from)
- startWith = allProjects[args.resume_from]
- startIndex = findInList(allProjects.values(), startWith)
- workProjects = allProjects.values()[startIndex:]
+ workProjects = allProjects.values() # all the projects
+# apply the "resume from"
+if args.resume_from is not None:
+ # find project index
+ startIndex = 0
+ while startIndex < len(workProjects):
+ if workProjects[startIndex].name == args.resume_from:
+ break # we found it
+ else:
+ startIndex += 1
+ if startIndex >= len(workProjects): # project not found
+ raise Exception("%s not found in list of projects to work on" % args.resume_from)
+ # start here
+ workProjects = workProjects[startIndex:]