def __init__(self, packed_file, is_composite): self.file_ = packed_file self.reader_ = glc_unpacker.PortableGlcReader(packed_file) self.unpacker_ = glc_unpacker.GlcUnpacker(self.reader_, is_composite, False) self.data_loc_ = glc_unpacker.PackageFileLoc() if not os.path.isfile(self.file_): raise UnpackerError("Unable to open %s" % self.file_)
def ServeLocalGlobe(self, globe_path, is_composite): """Sets which globe is being served.""" self.reader_ = glc_unpacker.PortableGlcReader(globe_path) if not self.reader_.IsOpen(): self.unpacker_ = None self.is_gee_ = False return self.unpacker_ = glc_unpacker.GlcUnpacker(self.reader_, is_composite, False) self.SetGlobePath(globe_path)
def ServeLocalGlobe(self, globe_path, is_composite): """Sets which globe is being served.""" self.reader_ = glc_unpacker.PortableGlcReader(globe_path) self.unpacker_ = glc_unpacker.GlcUnpacker(self.reader_, is_composite, False) self.SetGlobePath(globe_path) self.search_db_.ClearSearchTables() # Keep search separate and specific to glc. self.LoadSearchDb() print "Serving globe:", globe_path
def ServeLocalGlobeFiles(self, globe_path): """Sets which globe is being served, but will only serve top-level files.""" self.reader_ = glc_unpacker.PortableGlcReader(globe_path) if not self.reader_.IsOpen(): self.unpacker_ = None self.is_gee_ = False return self.unpacker_ = glc_unpacker.GlcUnpacker(self.reader_, globe_path[-4:] == ".glc", True) self.is_2d_ = self.unpacker_.Is2d() self.is_3d_ = self.unpacker_.Is3d() self.SetGlobePath(globe_path)
def ServeLocalGlobeFiles(self, globe_path): """Sets which globe is being served, but will only serve top-level files.""" globe_path = os.path.normpath(globe_path) if globe_path[-4:] == ".mbt": self.is_2d_ = True self.is_composite_ = False self.is_mbtiles_ = True else: self.reader_ = glc_unpacker.PortableGlcReader(globe_path) self.unpacker_ = glc_unpacker.GlcUnpacker(self.reader_, globe_path[-4:] == ".glc", True) self.is_2d_ = self.unpacker_.Is2d() self.is_3d_ = self.unpacker_.Is3d() self.is_mbtiles_ = False self.SetGlobePath(globe_path)