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
Commits
2419c7b60281
Commit
f2ef8a07
authored
May 23, 2019
by
Aurélien Campéas
Browse files
cli: show progress bar for long operation
parent
f020861b9185
Changes
2
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
2419c7b6
...
...
@@ -18,7 +18,8 @@ setup(name='tshistory',
'mock'
,
'pytest_sa_pg'
,
'inireader'
,
'colorama'
'colorama'
,
'tqdm'
],
entry_points
=
{
'console_scripts'
:
[
...
...
tshistory/cli.py
View file @
2419c7b6
...
...
@@ -288,14 +288,17 @@ def migrate_dot_6_to_dot_7(db_uri, namespace='tsh'):
'on delete set null'
)
print
(
'reclaim unreachable chunks left behind by strip'
)
from
tqdm
import
tqdm
from
tshistory.snapshot
import
Snapshot
for
name
in
tsh
.
list_series
(
e
):
series
=
tsh
.
list_series
(
e
)
bar
=
tqdm
(
range
(
len
(
series
)))
for
name
in
series
:
snap
=
Snapshot
(
e
,
tsh
,
name
)
garb
=
snap
.
garbage
()
if
garb
:
print
(
'************************'
,
name
,
'
garbage =
'
,
len
(
garb
))
if
reclaim
:
snap
.
reclaim
()
print
(
f
'
{
name
}
garbage =
{
len
(
garb
)
}
'
)
snap
.
reclaim
()
bar
.
update
()
def
register_plugin_subcommands
():
...
...
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