summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJF Ding <jian-feng.ding@intel.com>2011-12-28 11:37:51 +0800
committerJF Ding <jian-feng.ding@intel.com>2011-12-28 11:37:51 +0800
commite92db01992923ff6f4e37d1cb072eb77f1cf37bc (patch)
tree9bf35cc4f3c225408575e0137fe7aaa9ee1f43ec /tools
parent8df4cdd76945b97dcc036bcb0f5e0a6dd75c5e3d (diff)
downloadmic-e92db01992923ff6f4e37d1cb072eb77f1cf37bc.tar.gz
mic-e92db01992923ff6f4e37d1cb072eb77f1cf37bc.tar.bz2
mic-e92db01992923ff6f4e37d1cb072eb77f1cf37bc.zip
changes of message and coding style
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mic20
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/mic b/tools/mic
index dffb8a6..7b11c16 100755
--- a/tools/mic
+++ b/tools/mic
@@ -38,8 +38,12 @@ class MicCmd(cmdln.Cmdln):
def get_optparser(self):
optparser = cmdln.CmdlnOptionParser(self, version=self.version)
- optparser.add_option('-d', '--debug', action='store_true', dest='debug', help='print debug message')
- optparser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='verbose information')
+ optparser.add_option('-d', '--debug', action='store_true',
+ dest='debug',
+ help='print debug message')
+ optparser.add_option('-v', '--verbose', action='store_true',
+ dest='verbose',
+ help='verbose information')
return optparser
def postoptparse(self):
@@ -102,7 +106,8 @@ class MicCmd(cmdln.Cmdln):
raise errors.Usage("Extra argument given")
if not os.path.exists(srcimg):
- raise errors.CreatorError("Failed to find the image: %s" % srcimg)
+ raise errors.CreatorError("Cannot find the image: %s" % srcimg)
+
self._root_confirm()
srcformat = misc.get_image_type(srcimg)
@@ -118,7 +123,8 @@ class MicCmd(cmdln.Cmdln):
destimager = icls
if (srcimager and destimager) is None:
- raise errors.CreatorError("Can't convert from %s to %s" %(srcformat, destformat))
+ raise errors.CreatorError("Can't convert from %s to %s" \
+ % (srcformat, destformat))
else:
base_on = srcimager.do_unpack(srcimg)
destimager.do_pack(base_on)
@@ -146,8 +152,9 @@ class MicCmd(cmdln.Cmdln):
raise errors.Usage("Extra argument given")
if not os.path.exists(targetimage):
- raise errors.CreatorError("Failed to find the image: %s"
+ raise errors.CreatorError("Cannot find the image: %s"
% targetimage)
+
self._root_confirm()
imagetype = misc.get_image_type(targetimage)
@@ -161,7 +168,8 @@ class MicCmd(cmdln.Cmdln):
break
if not chrootclass:
- raise errors.CreatorError("Cannot support image type: %s" % imagetype)
+ raise errors.CreatorError("Cannot support image type: %s" \
+ % imagetype)
chrootclass.do_chroot(targetimage)