mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
refactor python reader to take a get_bytes function; add reader tests [#38]
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
from pmtiles.reader import read
|
||||
from pmtiles.reader import Reader, MmapSource
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print("Usage: pmtiles-show PMTILES_FILE")
|
||||
@@ -9,7 +9,8 @@ if len(sys.argv) <= 1:
|
||||
print("Usage: pmtiles-show PMTILES_FILE list")
|
||||
exit(1)
|
||||
|
||||
with read(sys.argv[1]) as reader:
|
||||
with open(sys.argv[1],'r+b') as f:
|
||||
reader = Reader(MmapSource(f))
|
||||
spec_version = reader.version
|
||||
if len(sys.argv) == 2:
|
||||
print("spec version: ", spec_version)
|
||||
|
||||
Reference in New Issue
Block a user