Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Tung committed Jul 12, 2019
2 parents e56d993 + e965171 commit 9f1e964
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion .hgtags
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
d0a100ad60012b4f0829a7903178f056e6eeb7a8 t1
3 changes: 3 additions & 0 deletions slicedimage/_tileset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from abc import abstractmethod

from ._dimensions import DimensionNames
from ._typeformatting import (
format_enum_keyed_dicts,
Expand Down Expand Up @@ -60,6 +62,7 @@ def __repr__(self):
shape = ", ".join(attributes)
return "<slicedimage.TileSet ({shape})>".format(shape=shape)

@abstractmethod
def validate(self):
raise NotImplementedError()

Expand Down
3 changes: 3 additions & 0 deletions slicedimage/backends/_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import hashlib
from abc import abstractmethod


class Backend:
@abstractmethod
def read_contextmanager(self, name, checksum_sha256=None):
"""
Returns a context manager, that when entered, should return a file-like object that can be
Expand All @@ -21,6 +23,7 @@ def read_contextmanager(self, name, checksum_sha256=None):
"""
raise NotImplementedError()

@abstractmethod
def write_file_handle(self, name):
raise NotImplementedError()

Expand Down
4 changes: 4 additions & 0 deletions slicedimage/cli/_base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from abc import abstractmethod


class CliCommand:
@classmethod
def register_parser(cls, subparser_root):
Expand All @@ -9,5 +12,6 @@ def register_parser(cls, subparser_root):
raise NotImplementedError()

@classmethod
@abstractmethod
def run_command(cls, args):
raise NotImplementedError()
2 changes: 2 additions & 0 deletions slicedimage/io/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def parse_doc(name_or_url, baseurl, backend_config=None):
def can_parse(cls, doc_version: version.Version):
raise NotImplementedError()

@abstractmethod
def parse(self, json_doc, baseurl, backend_config):
raise NotImplementedError()

Expand Down Expand Up @@ -87,6 +88,7 @@ def default_tile_opener(tileset_path, tile, ext):
delete=False,
)

@abstractmethod
def generate_partition_document(self, partition, path, pretty=False, *args, **kwargs):
raise NotImplementedError()

Expand Down

0 comments on commit 9f1e964

Please sign in to comment.