-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from OnroerendErfgoed/develop
Develop
- Loading branch information
Showing
23 changed files
with
353 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
language: python | ||
sudo: false | ||
python: | ||
- "2.7" | ||
- "3.6" | ||
- "3.8" | ||
env: | ||
- PROJECT=augeias | ||
install: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
from augeias.stores.PairTreeFileSystemStore import PairTreeFileSystemStore | ||
from augeias.collections.model import Collection | ||
import os | ||
|
||
from augeias.collections.model import Collection | ||
from augeias.stores.PairTreeFileSystemStore import PairTreeFileSystemStore | ||
|
||
|
||
def includeme(config): # pragma: no cover | ||
beeldbank = Collection(name='cheeses', object_store=PairTreeFileSystemStore(os.path.expanduser('~/data/cheeses/data'))) | ||
beeldbank = Collection(name='cheeses', object_store=PairTreeFileSystemStore( | ||
os.path.expanduser('~/data/cheeses/data'))) | ||
config.registry.collections[beeldbank.name] = beeldbank | ||
|
||
besluiten = Collection(name='trees', object_store=PairTreeFileSystemStore(os.path.expanduser('~/data/trees/data'))) | ||
besluiten = Collection(name='trees', object_store=PairTreeFileSystemStore( | ||
os.path.expanduser('~/data/trees/data'))) | ||
config.registry.collections[besluiten.name] = besluiten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from pyramid.scaffolds import PyramidTemplate | ||
|
||
|
||
class AugeiasTemplate(PyramidTemplate): | ||
_template_dir = 'augeias_scaffold' | ||
summary = 'Create a new Augeias instance.' |
2 changes: 0 additions & 2 deletions
2
augeias/scaffolds/augeias_scaffold/+package+/collections/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ def create_container(self, container_key): | |
pass | ||
|
||
def delete_container(self, container_key): | ||
pass | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,104 @@ | ||
# -*- coding: utf-8 -*- | ||
''' | ||
""" | ||
This module defines the interface every store needs to adhere to. | ||
''' | ||
""" | ||
|
||
from abc import ABCMeta, abstractmethod | ||
|
||
|
||
class IStore: | ||
''' | ||
""" | ||
This interface handles object-storage. | ||
Implementations of this interface can be made for different object-storages | ||
Currently this interface is only implemented for PairTreeFileSystemStore | ||
''' | ||
""" | ||
__metaclass__ = ABCMeta | ||
|
||
@abstractmethod | ||
def create_object(self, container_key, object_key, object_data): | ||
''' | ||
""" | ||
Save a new object in the data store | ||
:param str container_key: Key of the container to create an object in. | ||
:param str object_key: Key of the object to create. | ||
:param str object_data: The data for the object to create. | ||
:raises augeias.stores.error.NotFoundException: When the container could not be found. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def delete_object(self, container_key, object_key): | ||
''' | ||
""" | ||
Delete an object from the data store. | ||
:param str container_key: Key of the container that the object lives in. | ||
:param str object_key: Key of the object to delete. | ||
:raises augeias.stores.error.NotFoundException: When the object or container could not be found. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def get_object(self, container_key, object_key): | ||
''' | ||
""" | ||
Retrieve an object from the data store. | ||
:param str container_key: Key of the container that the object lives in. | ||
:param str object_key: Key of the object to retrieve. | ||
:raises augeias.stores.error.NotFoundException: When the object or container could not be found. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def get_object_info(self, container_key, object_key): | ||
''' | ||
""" | ||
Retrieve object info (mimetype, size, time last modification) from the data store. | ||
:param str container_key: Key of the container that the object lives in. | ||
:param str object_key: Key of the object to retrieve. | ||
:raises augeias.stores.error.NotFoundException: When the object or container could not be found. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def update_object(self, container_key, object_key, object_data): | ||
''' | ||
""" | ||
Update an object in the data store. | ||
:param str container_key: Key of the container that the object lives in. | ||
:param str object_key: Key of the object to update. | ||
:param str object_data: New data for the object. | ||
:raises augeias.stores.error.NotFoundException: When the object or container could not be found. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def list_object_keys_for_container(self, container_key): | ||
''' | ||
""" | ||
List all object keys for a container in the data store. | ||
:param str container_key: Key of the container to list the objects for. | ||
:returns: A list of container keys. | ||
:rtype: lst | ||
:raises augeias.stores.error.NotFoundException: When the container could not be found. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def get_container_data(self, container_key, translations=None): | ||
''' | ||
""" | ||
Find a container and return a zip file of its contents. | ||
:param container_key: Key of the container which must be retrieved. | ||
:param translations: Dict of object IDs and file names to use for them. | ||
:return: a zip file containing all files of the container. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def create_container(self, container_key): | ||
''' | ||
""" | ||
Create a new container in the data store. | ||
:param str container_key: Key of the container to create. | ||
''' | ||
""" | ||
|
||
@abstractmethod | ||
def delete_container(self, container_key): | ||
''' | ||
Delete a container and all it's objects in the data store. | ||
""" | ||
Delete a container and all it's objects in the data store. | ||
:param str container_key: Key of the container to delete. | ||
:raises augeias.stores.error.NotFoundException: When the container could not be found. | ||
''' | ||
""" |
Oops, something went wrong.