(self)
Common input checks for create command
Common input checks for create command
Common input checks for create command
def validate_create(self):
        """Common input checks for create command"""
        self.in1 = self.args.FILE[0]
        self.img = pygame.image.load(self.in1)

        if self.img.get_width() % self.edge != 0:
            sys.exit("error: image width is not a multiple of %d" % self.edge)
        if self.img.get_height() % self.edge != 0:
            sys.exit("error: image height is not a multiple of %d" % self.edge)

        self.size = self.args.size
        if self.size and self.size % self.multiple != 0:
            sys.exit("error: ROM size must be a multiple of %d" %
                     self.multiple)
def validate_create ( self ) : self . in1 = self . args . FILE [ 0 ] self . img = pygame . image . load ( self . in1 ) if self . img . get_width ( ) % self . edge != 0 : sys . exit ( "error: image width is not a multiple of %d" % self . edge ) if self . img . get_height ( ) % self . edge != 0 : sys . exit ( "error: image height is not a multiple of %d" % self . edge ) self . size = self . args . size if self . size and self . size % self . multiple != 0 : sys . exit ( "error: ROM size must be a multiple of %d" % self . multiple )