diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-01-31 12:37:45 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-02 17:37:44 +0000 |
| commit | 08217a4c80e4abba15270a6a023f0dd1dbadb84c (patch) | |
| tree | 5e5dc9849e24064ed040a9c243f46a48177ebfd6 /scripts/lib/wic/utils/oe/misc.py | |
| parent | d8a89baffbeced00025fb27dce102e11b8193075 (diff) | |
| download | poky-08217a4c80e4abba15270a6a023f0dd1dbadb84c.tar.gz | |
wic: partition: simlify calling plugin methods
Replaced parse_sourceparams function with list comprehension.
Used local variables instead of attributes.
Moved global variable to the local scope.
[YOCTO #10619]
(From OE-Core rev: 4adbac84046ff744f1452b5ff4d017d17d2d45e2)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/utils/oe/misc.py')
| -rw-r--r-- | scripts/lib/wic/utils/oe/misc.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py index 3737c4b1f0..6781d8381a 100644 --- a/scripts/lib/wic/utils/oe/misc.py +++ b/scripts/lib/wic/utils/oe/misc.py | |||
| @@ -222,26 +222,3 @@ def get_bitbake_var(var, image=None, cache=True): | |||
| 222 | get_var method of BB_VARS singleton. | 222 | get_var method of BB_VARS singleton. |
| 223 | """ | 223 | """ |
| 224 | return BB_VARS.get_var(var, image, cache) | 224 | return BB_VARS.get_var(var, image, cache) |
| 225 | |||
| 226 | def parse_sourceparams(sourceparams): | ||
| 227 | """ | ||
| 228 | Split sourceparams string of the form key1=val1[,key2=val2,...] | ||
| 229 | into a dict. Also accepts valueless keys i.e. without =. | ||
| 230 | |||
| 231 | Returns dict of param key/val pairs (note that val may be None). | ||
| 232 | """ | ||
| 233 | params_dict = {} | ||
| 234 | |||
| 235 | params = sourceparams.split(',') | ||
| 236 | if params: | ||
| 237 | for par in params: | ||
| 238 | if not par: | ||
| 239 | continue | ||
| 240 | if not '=' in par: | ||
| 241 | key = par | ||
| 242 | val = None | ||
| 243 | else: | ||
| 244 | key, val = par.split('=') | ||
| 245 | params_dict[key] = val | ||
| 246 | |||
| 247 | return params_dict | ||
