Example #1
0
 def from_file(self, filename, translate=False):
     """Load graphic from an image file."""
     if filename[-4:].lower() == '.lmp':
         self.data = util.readfile(filename)
     else:
         im = Image.open(filename)
         self.from_Image(im, translate)
Example #2
0
 def from_file(self, filename, translate=False):
     """Load graphic from an image file."""
     if filename[-4:].lower() == '.lmp':
         self.data = util.readfile(filename)
     else:
         im = Image.open(filename)
         self.from_Image(im, translate)
Example #3
0
 def from_file(self, source):
     """Load data from a file. Source may be a path name string
     or a file-like object (with a `write` method)."""
     self.data = util.readfile(source)
Example #4
0
 def from_file(self, source):
     """Load data from a file. Source may be a path name string
     or a file-like object (with a `write` method)."""
     self.data = util.readfile(source)