Skip to content

Commit

Permalink
Minor fixes for Grayspread.
Browse files Browse the repository at this point in the history
  • Loading branch information
scossu committed Mar 29, 2021
1 parent 4384a69 commit e01d199
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 61 deletions.
2 changes: 1 addition & 1 deletion lakesuperior/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setup(self, config_dir=None, config=None):
manually before passing it to the setup.
"""
if hasattr(self, 'app_globals'):
logger.warning('The environment is already set up.')
logger.info('The environment is already set up.')
return

if not config:
Expand Down
2 changes: 1 addition & 1 deletion lakesuperior/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def parse_config(config_dir=None):
# This will hold a dict of all configuration values.
_config = {}

logger.info(f'Reading configuration at {config_dir}')
print(f'Reading configuration at {config_dir}')

for cname in configs:
fname = path.join(config_dir, f'{cname}.yml')
Expand Down
96 changes: 48 additions & 48 deletions lakesuperior/etc.defaults/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,54 +126,54 @@ messaging:
# List of channels to send messages to.
#
# Each channel must define the `endpoint` and the `level` parameters.
routes:
routes: []

###
# Output handler. Currently only ``StompHandler`` is supported.
- handler: StompHandler

###
# Activate this route.
#
# If ``False``, no messages will be emitted for this route.
active: True

###
# Protocol version. One of ``10``, ``11`` or ``12``.
protocol: '11'

###
# Host IP address.
host: 127.0.0.1

###
# Host port.
port: 61613

###
# User name for authentication.
#
# Credentials are optional.
username:

###
# Password for authentication.
password:

###
# Message topic.
destination: '/topic/fcrepo'

###
# Message format: at the moment the following are supported:
#
# - ``ASResourceFormatter``: Sends information about a resource
# being created, updated or deleted, by who and when, with no
# further information about what changed.
#
# - ``ASDeltaFormatter``:
# Sends the same information as ``ASResourceFormatter`` with the
# addition of the triples that were added and the ones that were
# removed in the request. This may be used to send rich provenance
# data to a preservation system.
formatter: ASResourceFormatter
#- handler: StompHandler

# ###
# # Activate this route.
# #
# # If ``False``, no messages will be emitted for this route.
# active: True

# ###
# # Protocol version. One of ``10``, ``11`` or ``12``.
# protocol: '12'

# ###
# # Host IP address.
# host: 127.0.0.1

# ###
# # Host port.
# port: 61613

# ###
# # User name for authentication.
# #
# # Credentials are optional.
# username:

# ###
# # Password for authentication.
# password:

# ###
# # Message topic.
# destination: '/topic/fcrepo'

# ###
# # Message format: at the moment the following are supported:
# #
# # - ``ASResourceFormatter``: Sends information about a resource
# # being created, updated or deleted, by who and when, with no
# # further information about what changed.
# #
# # - ``ASDeltaFormatter``:
# # Sends the same information as ``ASResourceFormatter`` with the
# # addition of the triples that were added and the ones that were
# # removed in the request. This may be used to send rich provenance
# # data to a preservation system.
# formatter: ASResourceFormatter
14 changes: 8 additions & 6 deletions lakesuperior/model/ldp/ldpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,14 @@ def _enqueue_msg(self, ev_type, remove_trp=None, add_trp=None):
elif actor is None and t[1] == nsc['fcrepo'].createdBy:
actor = t[2]

env.app_globals.changelog.append((set(remove_trp), set(add_trp), {
'ev_type': ev_type,
'timestamp': thread_env.timestamp.format(),
'rsrc_type': rsrc_type,
'actor': actor,
}))
# Do not append messages if there are no routes to consume them.
if env.app_globals.config['application']['messaging']['routes']:
env.app_globals.changelog.append((set(remove_trp), set(add_trp), {
'ev_type': ev_type,
'timestamp': thread_env.timestamp.format(),
'rsrc_type': rsrc_type,
'actor': actor,
}))


def _check_ref_int(self, config):
Expand Down
4 changes: 1 addition & 3 deletions lakesuperior/model/rdf/graph.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ cdef class Graph:
"""
Initialize the graph, optionally from Python/RDFlib data.
An instance of this class is always tied to an underlying store because
it only keeps index keys of the graph terms. This allows for very fast
`lookup and manipulation sucha as boolean operations.
The data of a Graph object are an in-memory copy from the LMDB store.
When initializing a non-empty Graph, a store transaction must be
opened::
Expand Down
3 changes: 2 additions & 1 deletion lakesuperior/store/ldp_rs/lmdb_triplestore.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ INT_DUP_MASK = (
)

cdef:
# Term key to serialized term
DbLabel DB_T_ST = 't:st___',
# Joined triple keys to context key
DbLabel DB_SPO_C = 'spo:c__',
Expand All @@ -60,7 +61,7 @@ cdef:
# Indices
# Namespace to prefix
DbLabel DB_NS_PFX = 'ns:pfx_',
# Term hash to triple key
# Term hash to term key
DbLabel DB_TH_T = 'th:t___',
# 1-bound lookups
DbLabel DB_S_PO = 's:po___',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import lakesuperior

# Use this version to build C files from .pyx sources.
CYTHON_VERSION='0.29.6'
CYTHON_VERSION='0.29.22'

KLEN = 5 # TODO Move somewhere else (config?)

Expand Down

0 comments on commit e01d199

Please sign in to comment.