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
Kirill Smelkov
ZODB
Commits
a893fc76
Commit
a893fc76
authored
Jan 17, 2003
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor ZEOOptions into a reusable mixin and a ZEO-specific class.
parent
5ddbba39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
src/ZEO/runzeo.py
src/ZEO/runzeo.py
+18
-13
No files found.
src/ZEO/runzeo.py
View file @
a893fc76
...
@@ -46,7 +46,7 @@ def parse_address(arg):
...
@@ -46,7 +46,7 @@ def parse_address(arg):
obj
=
ZConfig
.
datatypes
.
SocketAddress
(
arg
)
obj
=
ZConfig
.
datatypes
.
SocketAddress
(
arg
)
return
obj
.
family
,
obj
.
address
return
obj
.
family
,
obj
.
address
class
ZEOOptions
(
ZDOptions
)
:
class
ZEOOptions
Mixin
:
storages
=
None
storages
=
None
...
@@ -74,13 +74,9 @@ class ZEOOptions(ZDOptions):
...
@@ -74,13 +74,9 @@ class ZEOOptions(ZDOptions):
conf
=
FileStorage
(
FSConfig
(
name
,
arg
))
conf
=
FileStorage
(
FSConfig
(
name
,
arg
))
self
.
storages
.
append
(
conf
)
self
.
storages
.
append
(
conf
)
def
__init__
(
self
):
def
add_zeo_options
(
self
):
self
.
schemadir
=
os
.
path
.
dirname
(
__file__
)
ZDOptions
.
__init__
(
self
)
self
.
add
(
None
,
None
,
"a:"
,
"address="
,
self
.
handle_address
)
self
.
add
(
None
,
None
,
"a:"
,
"address="
,
self
.
handle_address
)
self
.
add
(
None
,
None
,
"f:"
,
"filename="
,
self
.
handle_filename
)
self
.
add
(
None
,
None
,
"f:"
,
"filename="
,
self
.
handle_filename
)
self
.
add
(
"storages"
,
"storages"
,
required
=
"no storages specified; use -f or -C"
)
self
.
add
(
"family"
,
"zeo.address.family"
)
self
.
add
(
"family"
,
"zeo.address.family"
)
self
.
add
(
"address"
,
"zeo.address.address"
,
self
.
add
(
"address"
,
"zeo.address.address"
,
required
=
"no server address specified; use -a or -C"
)
required
=
"no server address specified; use -a or -C"
)
...
@@ -91,12 +87,6 @@ class ZEOOptions(ZDOptions):
...
@@ -91,12 +87,6 @@ class ZEOOptions(ZDOptions):
self
.
add
(
"monitor_address"
,
None
,
"m:"
,
"monitor="
,
self
.
add
(
"monitor_address"
,
None
,
"m:"
,
"monitor="
,
self
.
handle_monitor_address
)
self
.
handle_monitor_address
)
def
realize
(
self
,
*
args
):
ZDOptions
.
realize
(
self
,
*
args
)
if
self
.
args
:
self
.
usage
(
"positional arguments are not supported"
)
self
.
load_logconf
()
def
load_logconf
(
self
):
def
load_logconf
(
self
):
if
self
.
configroot
.
logger
is
not
None
:
if
self
.
configroot
.
logger
is
not
None
:
zLOG
.
set_initializer
(
self
.
log_initializer
)
zLOG
.
set_initializer
(
self
.
log_initializer
)
...
@@ -111,6 +101,21 @@ class ZEOOptions(ZDOptions):
...
@@ -111,6 +101,21 @@ class ZEOOptions(ZDOptions):
EventLogger
.
event_logger
.
logger
=
logger
EventLogger
.
event_logger
.
logger
=
logger
class
ZEOOptions
(
ZDOptions
,
ZEOOptionsMixin
):
def
__init__
(
self
):
self
.
schemadir
=
os
.
path
.
dirname
(
__file__
)
ZDOptions
.
__init__
(
self
)
self
.
add_zeo_options
()
self
.
add
(
"storages"
,
"storages"
,
required
=
"no storages specified; use -f or -C"
)
def
realize
(
self
,
*
args
):
ZDOptions
.
realize
(
self
,
*
args
)
if
self
.
configroot
is
not
None
:
self
.
load_logconf
()
class
ZEOServer
:
class
ZEOServer
:
def
__init__
(
self
,
options
):
def
__init__
(
self
,
options
):
...
...
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