Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
[Akshita Jha]
> This error occurs wherever "if sprosp['license'] == ' ' " is
> checked. I solved these errors by using try-except block:
>
> try:
> if sprosp['license'] == '':
> sprosp['license'] = 'free'
> except KeyError:
> sprosp['license'] = 'free'
Instead of a try/except block for this, I would suggest to use the 'in'
check like this:
if 'license' not in sprosp or sprosp['license'] == '':
sprosp['license'] = 'free'
I find it easier to understand and it avoid the exception overhead.
--
Happy hacking
Petter Reinholdtsen
Reply to:
- References:
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Akshita Jha <zenith158@gmail.com>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Andreas Tille <andreas@an3as.eu>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Akshita Jha <zenith158@gmail.com>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Andreas Tille <andreas@an3as.eu>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Akshita Jha <zenith158@gmail.com>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Andreas Tille <andreas@an3as.eu>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Akshita Jha <zenith158@gmail.com>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Andreas Tille <andreas@an3as.eu>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Andreas Tille <andreas@an3as.eu>
- Re: [GSoC] Adding information to UDD and inject the rendering to tasks,py
- From: Akshita Jha <zenith158@gmail.com>