Bug 1253110 - Implement GeneratedFile.read(); r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Thu, 21 Apr 2016 16:09:47 -0700
changeset 363134 8988e990dda08c2329d87eb39de8a075f617a0ef
parent 363133 5d02c4451a926f256885a94b783ebaad80086bb3
child 363135 822dbcb3f04ddb5d3b8e1c6dfefdde422f954c76
push id17107
push usergszorc@mozilla.com
push dateWed, 04 May 2016 00:54:14 +0000
reviewersglandium
bugs1253110
milestone49.0a1
Bug 1253110 - Implement GeneratedFile.read(); r?glandium This can get merged with the previous commit before landing. MozReview-Commit-ID: 3PqRejsjpkJ
python/mozbuild/mozpack/files.py
--- a/python/mozbuild/mozpack/files.py
+++ b/python/mozbuild/mozpack/files.py
@@ -486,16 +486,19 @@ class GeneratedFile(BaseFile):
     File class for content with no previous existence on the filesystem.
     '''
     def __init__(self, content):
         self.content = content
 
     def open(self):
         return BytesIO(self.content)
 
+    def read(self):
+        return self.content
+
 
 class DeflatedFile(BaseFile):
     '''
     File class for members of a jar archive. DeflatedFile.copy() effectively
     extracts the file from the jar archive.
     '''
     def __init__(self, file):
         from mozpack.mozjar import JarFileReader