+
+ # In case the target version and format are both specified
+ # verify that they are compatible. If not send a warning
+ # and ignore the version.
+ if final_version:
+ message = "Incompatible version %s for specified format %d" % (
+ final_version, self.end_format)
+ for version in format_relation:
+ if self.end_format in version[1]:
+ if final_version not in version[2]:
+ self.warning(message)
+ final_version = ""
+ elif final_version:
+ for version in format_relation:
+ if final_version in version[2]:
+ # set the last format for that version
+ self.end_format = version[1][-1]
+ break
+ else:
+ final_version = ""