Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
32eb1ded
Commit
32eb1ded
authored
6 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
use abc.abstractproperty
This gives clearer messages when someone gets it wrong
parent
71990b3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/server.py
+4
-5
4 additions, 5 deletions
synapse/server.py
with
4 additions
and
5 deletions
synapse/server.py
+
4
−
5
View file @
32eb1ded
...
...
@@ -19,6 +19,7 @@
# partial one for unit test mocking.
# Imports required for the default HomeServer() implementation
import
abc
import
logging
from
twisted.enterprise
import
adbapi
...
...
@@ -110,6 +111,8 @@ class HomeServer(object):
config (synapse.config.homeserver.HomeserverConfig):
"""
__metaclass__
=
abc
.
ABCMeta
DEPENDENCIES
=
[
'
http_client
'
,
'
db_pool
'
,
...
...
@@ -174,7 +177,7 @@ class HomeServer(object):
# This is overridden in derived application classes
# (such as synapse.app.homeserver.SynapseHomeServer) and gives the class to be
# instantiated during setup() for future return by get_datastore()
DATASTORE_CLASS
=
None
DATASTORE_CLASS
=
abc
.
abstractproperty
()
def
__init__
(
self
,
hostname
,
reactor
=
None
,
**
kwargs
):
"""
...
...
@@ -200,10 +203,6 @@ class HomeServer(object):
def
setup
(
self
):
logger
.
info
(
"
Setting up.
"
)
if
self
.
DATASTORE_CLASS
is
None
:
raise
RuntimeError
(
"
%s does not define a DATASTORE_CLASS
"
%
(
self
.
__class__
.
__name__
,
))
with
self
.
get_db_conn
()
as
conn
:
self
.
datastore
=
self
.
DATASTORE_CLASS
(
conn
,
self
)
logger
.
info
(
"
Finished setting up.
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment