(self)
Common input checks for extract command
Common input checks for extract command
Common input checks for extract command
def validate_extract(self):
        """Common input checks for extract command"""
        if self.args.output:
            if len(self.args.output) != 1:
                sys.exit("error: expected one image file, given: %s" %
                         " ".join(self.args.output))
            self.out = self.args.output[0]
        else:
            self.out = os.path.splitext(self.in1)[0]+'.bmp'

        if self.size % self.multiple != 0:
            sys.exit("error: ROM size must be a multiple of %d" %
                     self.multiple)
def validate_extract ( self ) : if self . args . output : if len ( self . args . output ) != 1 : sys . exit ( "error: expected one image file, given: %s" % " " . join ( self . args . output ) ) self . out = self . args . output [ 0 ] else : self . out = os . path . splitext ( self . in1 ) [ 0 ] + '.bmp' if self . size % self . multiple != 0 : sys . exit ( "error: ROM size must be a multiple of %d" % self . multiple )