From dcf9274b9589ba4380412e49c8cbc2dccabd4b83 Mon Sep 17 00:00:00 2001 From: Vangelis Koukis Date: Sat, 1 Sep 2012 18:29:47 +0300 Subject: [PATCH 1/1] Fix various typos, add .gitignore file Fix various typos in messages, add .gitignore file for automatically produced intermediate files. --- .gitignore | 4 ++++ image_creator/dialog_main.py | 12 ++++++------ image_creator/dialog_wizard.py | 4 ++-- image_creator/main.py | 10 +++++----- image_creator/os_type/__init__.py | 10 +++++----- image_creator/os_type/linux.py | 4 ++-- 6 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a204982 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pyc +build/ +dist/ +*.egg-info diff --git a/image_creator/dialog_main.py b/image_creator/dialog_main.py index 85e8a0b..2079269 100644 --- a/image_creator/dialog_main.py +++ b/image_creator/dialog_main.py @@ -360,12 +360,12 @@ def register_image(session): for key in session['task_metadata']: metadata[key] = 'yes' - gauge = GaugeOutput(d, "Image Registration", "Registrating image...") + gauge = GaugeOutput(d, "Image Registration", "Registering image...") try: out = dev.out out.add(gauge) try: - out.output("Registring image to cyclades...") + out.output("Registering image with Cyclades...") try: kamaki = Kamaki(session['account'], session['token'], out) kamaki.register(name, session['pithos_uri'], metadata) @@ -378,7 +378,7 @@ def register_image(session): finally: gauge.cleanup() - d.msgbox("Image `%s' was successfully registered to cyclades as `%s'" % + d.msgbox("Image `%s' was successfully registered with Cyclades as `%s'" % (session['upload'], name), width=MSGBOX_WIDTH) return True @@ -660,9 +660,9 @@ def sysprep(session): index += 1 (code, tags) = d.checklist( - "Please choose which system preperation tasks you would like to " + "Please choose which system preparation tasks you would like to " "run on the image. Press to see details about the system " - "preperation tasks.", title="Run system preperation tasks", + "preparation tasks.", title="Run system preparation tasks", choices=choices, width=70, ok_label="Run", help_button=1) if code in (d.DIALOG_CANCEL, d.DIALOG_ESC): @@ -746,7 +746,7 @@ def shrink(session): def customization_menu(session): d = session['dialog'] - choices = [("Sysprep", "Run various image preperation tasks"), + choices = [("Sysprep", "Run various image preparation tasks"), ("Shrink", "Shrink image"), ("View/Modify", "View/Modify image properties"), ("Delete", "Delete image properties"), diff --git a/image_creator/dialog_wizard.py b/image_creator/dialog_wizard.py index f61197d..4e2247d 100644 --- a/image_creator/dialog_wizard.py +++ b/image_creator/dialog_wizard.py @@ -268,7 +268,7 @@ def extract_image(session): out.success('done') out.output() - out.output('Registring image to ~okeanos...', False) + out.output('Registering image with ~okeanos...', False) kamaki.register(wizard['ImageName'], pithos_file, metadata) out.success('done') out.output() @@ -278,7 +278,7 @@ def extract_image(session): finally: out.remove(with_progress) - msg = "The image was successfully uploaded and registered to " \ + msg = "The image was successfully uploaded and registered with " \ "~okeanos. Would you like to keep a local copy of the image?" if not d.yesno(msg, width=PAGE_WIDTH): getattr(__import__("image_creator.dialog_main", diff --git a/image_creator/main.py b/image_creator/main.py index 85c9272..a12d863 100644 --- a/image_creator/main.py +++ b/image_creator/main.py @@ -88,12 +88,12 @@ def parse_options(input_args): parser.add_option("-r", "--register", dest="register", type="string", default=False, - help="register the image to ~okeanos as IMAGENAME", + help="register the image with ~okeanos as IMAGENAME", metavar="IMAGENAME") parser.add_option("-a", "--account", dest="account", type="string", default=account, help="Use this ACCOUNT when " - "uploading/registring images [Default: %s]" % account) + "uploading/registering images [Default: %s]" % account) parser.add_option("-m", "--metadata", dest="metadata", default=[], help="Add custom KEY=VALUE metadata to the image", @@ -101,7 +101,7 @@ def parse_options(input_args): parser.add_option("-t", "--token", dest="token", type="string", default=token, help="Use this token when " - "uploading/registring images [Default: %s]" % token) + "uploading/registering images [Default: %s]" % token) parser.add_option("--print-sysprep", dest="print_sysprep", default=False, help="print the enabled and disabled system preparation " @@ -117,7 +117,7 @@ def parse_options(input_args): metavar="SYSPREP") parser.add_option("--no-sysprep", dest="sysprep", default=True, - help="don't perform system preperation", + help="don't perform system preparation", action="store_false") parser.add_option("--no-shrink", dest="shrink", default=True, @@ -277,7 +277,7 @@ def image_creator(): out.output() if options.register: - out.output('Registring image to ~okeanos...', False) + out.output('Registering image with ~okeanos...', False) kamaki.register(options.register, uploaded_obj, metadata) out.success('done') out.output() diff --git a/image_creator/os_type/__init__.py b/image_creator/os_type/__init__.py index 5bb8226..c0fa505 100644 --- a/image_creator/os_type/__init__.py +++ b/image_creator/os_type/__init__.py @@ -115,15 +115,15 @@ class OSBase(object): return method def enable_sysprep(self, obj): - """Enable a system preperation operation""" + """Enable a system preparation operation""" setattr(obj.im_func, 'enabled', True) def disable_sysprep(self, obj): - """Disable a system preperation operation""" + """Disable a system preparation operation""" setattr(obj.im_func, 'enabled', False) def print_syspreps(self): - """Print enabled and disabled system preperation operations.""" + """Print enabled and disabled system preparation operations.""" syspreps = self.list_syspreps() enabled = filter(lambda x: x.enabled, syspreps) @@ -134,7 +134,7 @@ class OSBase(object): wrapper.initial_indent = '\t' wrapper.width = 72 - self.out.output("Enabled system preperation operations:") + self.out.output("Enabled system preparation operations:") if len(enabled) == 0: self.out.output("(none)") else: @@ -143,7 +143,7 @@ class OSBase(object): descr = wrapper.fill(textwrap.dedent(sysprep.__doc__)) self.out.output(' %s:\n%s\n' % (name, descr)) - self.out.output("Disabled system preperation operations:") + self.out.output("Disabled system preparation operations:") if len(disabled) == 0: self.out.output("(none)") else: diff --git a/image_creator/os_type/linux.py b/image_creator/os_type/linux.py index fd45152..0166129 100644 --- a/image_creator/os_type/linux.py +++ b/image_creator/os_type/linux.py @@ -156,12 +156,12 @@ class Linux(Unix): @sysprep() def use_persistent_block_device_names(self, print_header=True): """Scan fstab & grub configuration files and replace all non-persistent - device appearences with UUIDs. + device references with UUIDs. """ if print_header: self.out.output("Replacing fstab & grub non-persistent device " - "appearences") + "references") # convert all devices in fstab to persistent persistent_root = self._persistent_fstab() -- 1.7.10.4