Skip to content

Commit

Permalink
fix spelling of instrumented
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbugs committed Jun 4, 2019
1 parent db26153 commit 5dfb94a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ontquery/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, *services, prefix=tuple(), category=tuple(), instrumented=Non
self._services = tuple(_services)
if instrumented:
self._instrumented = instrumented
self._OntId = self._instrumented._uninstrumeted_class()
self._OntId = self._instrumented._uninstrumented_class()

else:
raise TypeError('instrumented is a required keyword argument')
Expand Down
2 changes: 1 addition & 1 deletion ontquery/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setup(self, instrumented=None, **kwargs):
if instrumented is None:
raise TypeError('OntTerm is a required argument!') # FIXME only require instrumented

self.OntId = instrumented._uninstrumeted_class()
self.OntId = instrumented._uninstrumented_class()
self.OntTerm = instrumented
self.QueryResult = QueryResult.new_from_instrumented(instrumented)

Expand Down
8 changes: 4 additions & 4 deletions ontquery/terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,18 @@ def query_init(cls, *services, query_class=None, **kwargs):
'a complete revamp along the lines of pathlib so that an '
'instrumented class can be initialized from the side')

instrumented = cls._instrumeted_class()
instrumented = cls._instrumented_class()
cls.query = query_class(*services, instrumented=instrumented, **kwargs)
return cls.query

@classmethod
def _instrumeted_class(cls):
def _instrumented_class(cls):
if issubclass(cls, InstrumentedIdentifier):
return cls

elif issubclass(cls, Identifier):
# when initing from an uninstrumented id the last
# instrumeted subclass prior to the next uninstrumented
# instrumented subclass prior to the next uninstrumented
# subclass will be used, so if I subclass OntId to create
# OrcId (an identifier for residents of Mordor) and also
# subclass to create OntTerm, and then OrcRecord, OntId
Expand All @@ -193,7 +193,7 @@ def _instrumeted_class(cls):
raise TypeError(f'Don\'t know what to do with a {type(cls)}')

@classmethod
def _uninstrumeted_class(cls):
def _uninstrumented_class(cls):
if issubclass(cls, InstrumentedIdentifier):
for candidate in cls.mro():
if (issubclass(candidate, Identifier) and not
Expand Down

0 comments on commit 5dfb94a

Please sign in to comment.