~linaro-automation/launchpad-work-items-tracker/linaro

« back to all changes in this revision

Viewing changes to collect

Pull work items from both the whiteboard and the new .workitems_text property

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
        model_bp, model_bp.milestone_name, collector.lp, people_cache=people_cache,
210
210
        error_collector=error_collector)
211
211
 
212
 
    if bp.whiteboard:
213
 
        for l in bp.whiteboard.splitlines():
214
 
 
215
 
            if (not in_workitems_block
216
 
                and not in_meta_block and not in_complexity_block):
 
212
    # Get work items from both the whiteboard and the new workitems_text
 
213
    # property. Once the migration is completed and nobody's using the
 
214
    # whiteboard for work items we can change this to pull work items only
 
215
    # from bp.workitems_text.
 
216
    workitems_text = bp.whiteboard
 
217
    if getattr(bp, 'workitems_text', '') != '':
 
218
        workitems_text += "\n" + bp.workitems_text
 
219
    if workitems_text:
 
220
        for l in workitems_text.splitlines():
 
221
            if not in_workitems_block:
217
222
                m = work_items_re.search(l)
218
223
                if m:
219
224
                    in_workitems_block = True
221
226
                    milestone = milestone_extract(m.group(1), valid_milestones)
222
227
                    dbg('  ... setting milestone to ' + str(milestone))
223
228
                    parser.milestone_name = milestone or parser.blueprint.milestone_name
224
 
                if meta_re.search(l):
225
 
                    in_meta_block = True
226
 
                if complexity_re.search(l):
227
 
                    in_complexity_block = True
228
229
                continue
229
230
 
230
231
            if in_workitems_block:
237
238
                if workitem is not None:
238
239
                    work_items.append(workitem)
239
240
 
 
241
    if bp.whiteboard:
 
242
        for l in bp.whiteboard.splitlines():
 
243
            if not in_meta_block and not in_complexity_block:
 
244
                if meta_re.search(l):
 
245
                    in_meta_block = True
 
246
                if complexity_re.search(l):
 
247
                    in_complexity_block = True
 
248
                continue
 
249
 
240
250
            if in_meta_block:
241
251
                dbg("\tmeta line (raw): '%s'" % (l.strip()))
242
252
                if not l.strip():