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
Joshua
zodb
Commits
4d01f5f7
Commit
4d01f5f7
authored
Nov 21, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename opts to options.
parent
dffafde8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
src/ZEO/runsvr.py
src/ZEO/runsvr.py
+20
-20
No files found.
src/ZEO/runsvr.py
View file @
4d01f5f7
...
...
@@ -80,12 +80,12 @@ class Options:
doc
+=
"
\
n
"
self
.
doc
=
doc
try
:
self
.
opts
,
self
.
args
=
getopt
.
getopt
(
args
,
self
.
_short_options
,
self
.
_long_options
)
self
.
opt
ion
s
,
self
.
args
=
getopt
.
getopt
(
args
,
self
.
_short_options
,
self
.
_long_options
)
except
getopt
.
error
,
msg
:
self
.
usage
(
str
(
msg
))
for
opt
,
arg
in
self
.
opts
:
for
opt
,
arg
in
self
.
opt
ion
s
:
self
.
handle_option
(
opt
,
arg
)
self
.
check_options
()
...
...
@@ -194,10 +194,10 @@ class ZEOServer:
OptionsClass
=
ZEOOptions
def
__init__
(
self
,
opts
=
None
):
if
opts
is
None
:
opts
=
self
.
OptionsClass
()
self
.
opt
s
=
opt
s
def
__init__
(
self
,
opt
ion
s
=
None
):
if
opt
ion
s
is
None
:
opt
ion
s
=
self
.
OptionsClass
()
self
.
opt
ions
=
option
s
def
main
(
self
):
self
.
check_socket
()
...
...
@@ -212,9 +212,9 @@ class ZEOServer:
self
.
clear_socket
()
def
check_socket
(
self
):
if
self
.
can_connect
(
self
.
opt
s
.
family
,
self
.
opt
s
.
address
):
self
.
opts
.
usage
(
"address %s already in use"
%
repr
(
self
.
opt
s
.
address
))
if
self
.
can_connect
(
self
.
opt
ions
.
family
,
self
.
option
s
.
address
):
self
.
opt
ion
s
.
usage
(
"address %s already in use"
%
repr
(
self
.
option
s
.
address
))
def
can_connect
(
self
,
family
,
address
):
s
=
socket
.
socket
(
family
,
socket
.
SOCK_STREAM
)
...
...
@@ -227,19 +227,19 @@ class ZEOServer:
return
1
def
clear_socket
(
self
):
if
isinstance
(
self
.
opts
.
address
,
type
(
""
)):
if
isinstance
(
self
.
opt
ion
s
.
address
,
type
(
""
)):
try
:
os
.
unlink
(
self
.
opts
.
address
)
os
.
unlink
(
self
.
opt
ion
s
.
address
)
except
os
.
error
:
pass
def
open_storages
(
self
):
if
self
.
opts
.
storages
:
self
.
load_storages
(
self
.
opts
.
storages
)
if
self
.
opt
ion
s
.
storages
:
self
.
load_storages
(
self
.
opt
ion
s
.
storages
)
else
:
from
ZODB.FileStorage
import
FileStorage
info
(
"opening storage '1': %r"
%
self
.
opts
.
filename
)
storage
=
FileStorage
(
self
.
opts
.
filename
)
info
(
"opening storage '1': %r"
%
self
.
opt
ion
s
.
filename
)
storage
=
FileStorage
(
self
.
opt
ion
s
.
filename
)
self
.
storages
=
{
"1"
:
storage
}
def
load_storages
(
self
,
storages
):
...
...
@@ -288,7 +288,7 @@ class ZEOServer:
def
create_server
(
self
):
from
ZEO.StorageServer
import
StorageServer
self
.
server
=
StorageServer
(
self
.
opts
.
address
,
self
.
storages
)
self
.
server
=
StorageServer
(
self
.
opt
ion
s
.
address
,
self
.
storages
)
def
loop_forever
(
self
):
import
asyncore
...
...
@@ -380,8 +380,8 @@ def _log(msg, severity=zLOG.INFO, error=None):
# Main program
def
main
(
args
=
None
):
opts
=
ZEOOptions
(
args
)
s
=
ZEOServer
(
opts
)
opt
ion
s
=
ZEOOptions
(
args
)
s
=
ZEOServer
(
opt
ion
s
)
s
.
main
()
if
__name__
==
"__main__"
:
...
...
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