def Load(self): basename, ext = os.path.splitext(self.filename) if ext != '.bz2': basename = self.filename stream = os.popen('bzip2 -d -c ' + sh_quote(self.filename)) doc = load.load_drawing_from_file(stream, basename, doc_class = self.doc_class) if doc: doc.meta.compressed = "bzip2" doc.meta.compressed_file = self.filename self.messages = doc.meta.load_messages return doc
def Load(self): basename, ext = os.path.splitext(self.filename) if ext != '.bz2': basename = self.filename stream = os.popen('bzip2 -d -c ' + sh_quote(self.filename)) doc = load.load_drawing_from_file(stream, basename, doc_class=self.doc_class) if doc: doc.meta.compressed = "bzip2" doc.meta.compressed_file = self.filename self.messages = doc.meta.load_messages return doc
def Load(self): if self.filename: basename, ext = os.path.splitext(self.filename) if ext != '.gz': basename = self.filename stream = os.popen('gzip -d -c ' + sh_quote(self.filename)) doc = load.load_drawing_from_file(stream, basename, doc_class = self.doc_class) if doc: doc.meta.compressed = "gzip" doc.meta.compressed_file = self.filename self.messages = doc.meta.load_messages return doc raise SketchLoadError('gziploader must be instantiated with filename')
def Load(self): if self.filename: basename, ext = os.path.splitext(self.filename) if ext != '.gz': basename = self.filename stream = os.popen('gzip -d -c ' + sh_quote(self.filename)) doc = load.load_drawing_from_file(stream, basename, doc_class=self.doc_class) if doc: doc.meta.compressed = "gzip" doc.meta.compressed_file = self.filename self.messages = doc.meta.load_messages return doc raise SketchLoadError('gziploader must be instantiated with filename')