Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pony
tshistory_supervision
Commits
e04c1b90cae7
Commit
3ec363a6
authored
Jun 28, 2019
by
Aurélien Campéas
Browse files
cli: provide an override for the shell command
parent
bf0fdfff7fdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
e04c1b90
...
...
@@ -13,7 +13,8 @@ setup(name='tshistory_supervision',
'tshistory'
],
entry_points
=
{
'tshistory.subcommands'
:
[
'migrate-supervision=tshistory_supervision.cli:migrate_supervision'
'migrate-supervision=tshistory_supervision.cli:migrate_supervision'
,
'shell=tshistory_supervision.cli:shell'
]},
classifiers
=
[
'Development Status :: 4 - Beta'
,
...
...
tshistory_supervision/cli.py
View file @
e04c1b90
...
...
@@ -3,6 +3,8 @@ import click
from
sqlalchemy
import
create_engine
from
tshistory.util
import
find_dburi
from
tshistory_supervision.tsio
import
timeseries
@
click
.
command
(
name
=
'migrate-supervision'
)
@
click
.
argument
(
'dburi'
)
...
...
@@ -23,3 +25,13 @@ def migrate_supervision(dburi, skip_schema=False, namespace='tsh'):
f
'alter schema "
{
namespace
}
-automatic.snapshot" '
f
'rename to "
{
namespace
}
-upstream.snapshot"'
)
@
click
.
command
(
name
=
'shell'
)
@
click
.
argument
(
'db-uri'
)
@
click
.
option
(
'--namespace'
,
default
=
'tsh'
)
def
shell
(
db_uri
,
namespace
=
'tsh'
):
e
=
create_engine
(
find_dburi
(
db_uri
))
tsh
=
timeseries
(
namespace
)
import
pdb
;
pdb
.
set_trace
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment