I think here we only want to ignore the error if the directory already
exists, right? In that case we should either check for its existence
before trying os.mkdir() or catch OSError but only ignore it if errno is
17 (file already exists). I think the former is clearer, but either is
fine, really.
Hi Mattias,
This looks good to me; just one suggestion below.
review approve
On Mon, 2011-12-12 at 09:32 +0000, Mattias Backman wrote: join(opts. output_ dir, '..', 'lane') lanessubdir)
[...]
> === modified file 'generate-all'
> --- generate-all 2011-12-07 09:03:27 +0000
> +++ generate-all 2011-12-12 09:28:04 +0000
> @@ -83,6 +83,18 @@
> except OSError:
> None
>
> +lanessubdir = os.path.
> +try:
> + os.mkdir(
> +except OSError:
> + None
I think here we only want to ignore the error if the directory already
exists, right? In that case we should either check for its existence
before trying os.mkdir() or catch OSError but only ignore it if errno is
17 (file already exists). I think the former is clearer, but either is
fine, really.
> + join(opts. output_ dir, '..', 'card') cardssubdir)
> +cardssubdir = os.path.
> +try:
> + os.mkdir(
> +except OSError:
> + None
Same here.
> + tools.lanes( store): join(opts. output_ dir, 'roadmap-' + lane.name) join(lanessubdi r, lane.name) tools.roadmap_ pages(my_ path, opts.database, basename, opts.config, join(opts. output_ dir, 'roadmap-card-%s' % page_name) join(cardssubdi r, page_name) tools.roadmap_ cards(my_ path, opts.database, basename, opts.config,
> for u in users:
> for m in milestones:
> target = u + '-' + m
> @@ -156,7 +168,7 @@
>
> # roadmap lanes
> for lane in report_
> - basename = os.path.
> + basename = os.path.
> report_
> lane, root=opts.root)
>
> @@ -165,8 +177,8 @@
> if card.roadmap_id != '':
> page_name = card.roadmap_id
> else:
> - page_name = card.card_id
> - basename = os.path.
> + page_name = str(card.card_id)
> + basename = os.path.
> report_
> card, root=opts.root)