summaryrefslogtreecommitdiff
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-01-19 18:51:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-19 21:30:37 +0000
commit6e5dd42727b40c6b5ba6235026a6cfc78f482ac9 (patch)
tree7b11facb6fcb4e7bb140174cf36aa7f7aa854e78 /scripts/lib/wic
parent7481f39382e63ecbb5de406559cc28e5689bd974 (diff)
downloadopenembedded-core-6e5dd42727b40c6b5ba6235026a6cfc78f482ac9.tar.gz
openembedded-core-6e5dd42727b40c6b5ba6235026a6cfc78f482ac9.tar.bz2
openembedded-core-6e5dd42727b40c6b5ba6235026a6cfc78f482ac9.zip
wic: pylinted ksparser module
Added missing docstrings, fixed wrong indentation and long lines. Final pylint score is 9.89/10 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')
-rw-r--r--scripts/lib/wic/ksparser.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 3722799b51..f2a0e04744 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -21,9 +21,9 @@
# This module provides parser for kickstart format
#
# AUTHORS
-# Tom Zanussi <tom.zanussi (at] linux.intel.com>
# Ed Bartosh <ed.bartosh> (at] linux.intel.com>
+"""Kickstart parser module."""
import os
import shlex
@@ -33,6 +33,7 @@ from wic.partition import Partition
from wic.utils.misc import find_canned
class KickStartError(Exception):
+ """Custom exception."""
pass
class KickStartParser(ArgumentParser):
@@ -91,6 +92,8 @@ def cannedpathtype(arg):
return result
class KickStart(object):
+ """"Kickstart parser implementation."""
+
def __init__(self, confpath):
self.partitions = []
@@ -134,6 +137,9 @@ class KickStart(object):
self._parse(parser, confpath)
def _parse(self, parser, confpath):
+ """
+ Parse file in .wks format using provided parser.
+ """
with open(confpath) as conf:
lineno = 0
for line in conf:
@@ -152,7 +158,8 @@ class KickStart(object):
self._parse(parser, parsed.path)
elif line.startswith('bootloader'):
if not self.bootloader:
- self.bootloader = parsed
+ self.bootloader = parsed
else:
- raise KickStartError("%s:%d: more than one bootloader "\
- "specified" % (confpath, lineno))
+ err = "%s:%d: more than one bootloader specified" \
+ % (confpath, lineno)
+ raise KickStartError(err)