Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
f518c990
Commit
f518c990
authored
Sep 25, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Untested update to make this code work with ZEO 2 by default.
parent
426ba922
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
src/scripts/zeopack.py
src/scripts/zeopack.py
+19
-5
No files found.
src/scripts/zeopack.py
View file @
f518c990
...
...
@@ -15,8 +15,11 @@ Options:
-d days -- pack objects more than days old
-1 -- Connect to a ZEO 1 server
-W -- wait for server to come up. Normally the script tries to
connect for 10 seconds, then exits with an error.
connect for 10 seconds, then exits with an error. The -W
option is only supported with ZEO 1.
You must specify either -p and -h or -U.
"""
...
...
@@ -43,7 +46,7 @@ def connect(storage):
return
raise
RuntimeError
,
"Unable to connect to ZEO server"
def
pack
(
addr
,
storage
,
days
,
wait
):
def
pack
1
(
addr
,
storage
,
days
,
wait
):
cs
=
ClientStorage
(
addr
,
storage
=
storage
,
wait_for_server_on_startup
=
wait
)
if
wait
:
# _startup() is an artifact of the way ZEO 1.0 works. The
...
...
@@ -57,6 +60,11 @@ def pack(addr, storage, days, wait):
cs
.
pack
(
wait
=
1
,
days
=
days
)
cs
.
close
()
def
pack2
(
addr
,
storage
,
days
,
wait
):
cs
=
ClientStorage
(
addr
,
storage
=
storage
,
wait
=
1
)
cs
.
pack
(
wait
=
1
,
days
=
days
)
cs
.
close
()
def
usage
(
exit
=
1
):
print
__doc__
print
" "
.
join
(
sys
.
argv
)
...
...
@@ -69,8 +77,9 @@ def main():
storage
=
'1'
days
=
0
wait
=
0
zeoversion
=
2
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'p:h:U:S:d:W'
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'p:h:U:S:d:W
1
'
)
for
o
,
a
in
opts
:
if
o
==
'-p'
:
port
=
int
(
a
)
...
...
@@ -84,6 +93,8 @@ def main():
days
=
int
(
a
)
elif
o
==
'-W'
:
wait
=
1
elif
o
==
'-1'
:
zeoversion
=
1
except
Exception
,
err
:
print
err
usage
()
...
...
@@ -96,8 +107,11 @@ def main():
if
port
is
None
:
usage
()
addr
=
host
,
port
pack
(
addr
,
storage
,
days
,
wait
)
if
zeoversion
==
1
:
pack1
(
addr
,
storage
,
days
,
wait
)
else
:
pack
(
addr
,
storage
,
days
)
if
__name__
==
"__main__"
:
try
:
...
...
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