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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
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:
...
@@ -80,12 +80,12 @@ class Options:
doc
+=
"
\
n
"
doc
+=
"
\
n
"
self
.
doc
=
doc
self
.
doc
=
doc
try
:
try
:
self
.
opts
,
self
.
args
=
getopt
.
getopt
(
args
,
self
.
opt
ion
s
,
self
.
args
=
getopt
.
getopt
(
args
,
self
.
_short_options
,
self
.
_short_options
,
self
.
_long_options
)
self
.
_long_options
)
except
getopt
.
error
,
msg
:
except
getopt
.
error
,
msg
:
self
.
usage
(
str
(
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
.
handle_option
(
opt
,
arg
)
self
.
check_options
()
self
.
check_options
()
...
@@ -194,10 +194,10 @@ class ZEOServer:
...
@@ -194,10 +194,10 @@ class ZEOServer:
OptionsClass
=
ZEOOptions
OptionsClass
=
ZEOOptions
def
__init__
(
self
,
opts
=
None
):
def
__init__
(
self
,
opt
ion
s
=
None
):
if
opts
is
None
:
if
opt
ion
s
is
None
:
opts
=
self
.
OptionsClass
()
opt
ion
s
=
self
.
OptionsClass
()
self
.
opt
s
=
opt
s
self
.
opt
ions
=
option
s
def
main
(
self
):
def
main
(
self
):
self
.
check_socket
()
self
.
check_socket
()
...
@@ -212,9 +212,9 @@ class ZEOServer:
...
@@ -212,9 +212,9 @@ class ZEOServer:
self
.
clear_socket
()
self
.
clear_socket
()
def
check_socket
(
self
):
def
check_socket
(
self
):
if
self
.
can_connect
(
self
.
opt
s
.
family
,
self
.
opt
s
.
address
):
if
self
.
can_connect
(
self
.
opt
ions
.
family
,
self
.
option
s
.
address
):
self
.
opts
.
usage
(
"address %s already in use"
%
self
.
opt
ion
s
.
usage
(
"address %s already in use"
%
repr
(
self
.
opt
s
.
address
))
repr
(
self
.
option
s
.
address
))
def
can_connect
(
self
,
family
,
address
):
def
can_connect
(
self
,
family
,
address
):
s
=
socket
.
socket
(
family
,
socket
.
SOCK_STREAM
)
s
=
socket
.
socket
(
family
,
socket
.
SOCK_STREAM
)
...
@@ -227,19 +227,19 @@ class ZEOServer:
...
@@ -227,19 +227,19 @@ class ZEOServer:
return
1
return
1
def
clear_socket
(
self
):
def
clear_socket
(
self
):
if
isinstance
(
self
.
opts
.
address
,
type
(
""
)):
if
isinstance
(
self
.
opt
ion
s
.
address
,
type
(
""
)):
try
:
try
:
os
.
unlink
(
self
.
opts
.
address
)
os
.
unlink
(
self
.
opt
ion
s
.
address
)
except
os
.
error
:
except
os
.
error
:
pass
pass
def
open_storages
(
self
):
def
open_storages
(
self
):
if
self
.
opts
.
storages
:
if
self
.
opt
ion
s
.
storages
:
self
.
load_storages
(
self
.
opts
.
storages
)
self
.
load_storages
(
self
.
opt
ion
s
.
storages
)
else
:
else
:
from
ZODB.FileStorage
import
FileStorage
from
ZODB.FileStorage
import
FileStorage
info
(
"opening storage '1': %r"
%
self
.
opts
.
filename
)
info
(
"opening storage '1': %r"
%
self
.
opt
ion
s
.
filename
)
storage
=
FileStorage
(
self
.
opts
.
filename
)
storage
=
FileStorage
(
self
.
opt
ion
s
.
filename
)
self
.
storages
=
{
"1"
:
storage
}
self
.
storages
=
{
"1"
:
storage
}
def
load_storages
(
self
,
storages
):
def
load_storages
(
self
,
storages
):
...
@@ -288,7 +288,7 @@ class ZEOServer:
...
@@ -288,7 +288,7 @@ class ZEOServer:
def
create_server
(
self
):
def
create_server
(
self
):
from
ZEO.StorageServer
import
StorageServer
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
):
def
loop_forever
(
self
):
import
asyncore
import
asyncore
...
@@ -380,8 +380,8 @@ def _log(msg, severity=zLOG.INFO, error=None):
...
@@ -380,8 +380,8 @@ def _log(msg, severity=zLOG.INFO, error=None):
# Main program
# Main program
def
main
(
args
=
None
):
def
main
(
args
=
None
):
opts
=
ZEOOptions
(
args
)
opt
ion
s
=
ZEOOptions
(
args
)
s
=
ZEOServer
(
opts
)
s
=
ZEOServer
(
opt
ion
s
)
s
.
main
()
s
.
main
()
if
__name__
==
"__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