Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
425d1edd
Commit
425d1edd
authored
7 years ago
by
furion
Browse files
Options
Downloads
Patches
Plain Diff
fix bottle dependencies and imports
parent
0722483e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/serve.py
+10
-17
10 additions, 17 deletions
server/serve.py
setup.py
+9
-3
9 additions, 3 deletions
setup.py
with
19 additions
and
20 deletions
server/serve.py
+
10
−
17
View file @
425d1edd
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import
os
import
json
import
json
import
logging
import
os
from
datetime
import
datetime
from
datetime
import
datetime
# pylint: disable=import-error, unused-import
import
bottle
import
bottle
from
bottle.ext
import
sqlalchemy
# pylint: enable=import-error
from
bottle
import
request
from
bottle
import
abort
from
bottle
import
abort
from
bottle_errorsrest
import
ErrorsRestPlugin
from
bottle_errorsrest
import
ErrorsRestPlugin
from
bottle_sqlalchemy
import
Plugin
from
sbds.sbds_json
import
ToStringJSONEncoder
from
sbds.server.jsonrpc
import
register_endpoint
from
steem.steemd
import
Steemd
from
hive.core
import
db_last_block
from
hive.core
import
db_last_block
from
hive.schema
import
metadata
as
hive_metadata
from
hive.schema
import
metadata
as
hive_metadata
from
sqlalchemy
import
create_engine
from
sqlalchemy
import
create_engine
from
steem.steemd
import
Steemd
from
sbds.sbds_json
import
ToStringJSONEncoder
from
sbds.server.jsonrpc
import
register_endpoint
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
app
=
bottle
.
Bottle
()
app
=
bottle
.
Bottle
()
...
@@ -32,10 +28,9 @@ app.config['hive.logger'] = logger
...
@@ -32,10 +28,9 @@ app.config['hive.logger'] = logger
def
get_db_plugin
(
database_url
):
def
get_db_plugin
(
database_url
):
sa_engine
=
create_engine
(
database_url
)
sa_engine
=
create_engine
(
database_url
)
Session
.
configure
(
bind
=
sa_engine
)
# pylint: disable=undefined-variable
# pylint: disable=undefined-variable
return
sqlalchemy
.
Plugin
(
return
Plugin
(
# SQLAlchemy engine created with create_engine function.
# SQLAlchemy engine created with create_engine function.
sa_engine
,
sa_engine
,
# SQLAlchemy metadata, required only if create=True.
# SQLAlchemy metadata, required only if create=True.
...
@@ -46,9 +41,9 @@ def get_db_plugin(database_url):
...
@@ -46,9 +41,9 @@ def get_db_plugin(database_url):
create
=
False
,
create
=
False
,
# If it is true, plugin commit changes after route is executed (default True).
# If it is true, plugin commit changes after route is executed (default True).
commit
=
False
,
commit
=
False
,
# If
it is t
rue and keyword is not defined, plugin uses **kwargs argument to inject session database (default False).
# If
T
rue and keyword is not defined, plugin uses **kwargs argument to inject session database (default False).
use_kwargs
=
False
,
use_kwargs
=
False
,
create_session
=
Session
)
)
app
.
install
(
app
.
install
(
...
@@ -84,8 +79,6 @@ def health(db):
...
@@ -84,8 +79,6 @@ def health(db):
# --------------
# --------------
jsonrpc
=
register_endpoint
(
path
=
'
/
'
,
app
=
app
,
namespace
=
'
hive
'
)
jsonrpc
=
register_endpoint
(
path
=
'
/
'
,
app
=
app
,
namespace
=
'
hive
'
)
# WSGI application
# WSGI application
# ----------------
# ----------------
application
=
app
application
=
app
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
9
−
3
View file @
425d1edd
...
@@ -26,11 +26,17 @@ setup(
...
@@ -26,11 +26,17 @@ setup(
install_requires
=
[
install_requires
=
[
'
steem
'
,
'
steem
'
,
'
maya
'
,
'
bottle
'
,
'
toolz
'
,
'
bottle-sqlalchemy
'
,
'
funcy
'
,
'
bottle_errorsrest
'
,
'
sqlalchemy
'
,
'
sqlalchemy
'
,
'
mysqlclient
'
,
'
mysqlclient
'
,
'
click
'
,
'
click-spinner
'
,
'
funcy
'
,
'
toolz
'
,
'
maya
'
,
'
ujson
'
,
],
],
entry_points
=
{
entry_points
=
{
'
console_scripts
'
:
[
'
console_scripts
'
:
[
...
...
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