'Ensure that the version property of the manifest exists and is a string
containing one to four dot-separated integers, each between 0 and
65535, with no leading zeros.'

def validate_version(self, manifest_json):

    try:
        version = manifest_json['version']
    except KeyError:
        self.error('VERSION_MISSING')
    if (not isinstance(version, basestring)):
        self.error('VERSION_NOT_STRING')
    splitted = version.split('.')
    if (len(splitted) > 4):
        self.error('VERSION_INVALID')
    for version_component in splitted:
        try:
            number = int(version_component)
            if (version_component.startswith('0') and (number != 0)):
                self.error('VERSION_INVALID')
            if ((number < 0) or (number > 65535)):
                self.error('VERSION_INVALID')
        except ValueError:
            self.error('VERSION_INVALID')
