Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
ffe0f9f9
Commit
ffe0f9f9
authored
Jul 07, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'debug' and 'run' commands to zopectl.
parent
725a9822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
lib/python/Zope/Startup/zopectl.py
lib/python/Zope/Startup/zopectl.py
+37
-1
No files found.
lib/python/Zope/Startup/zopectl.py
View file @
ffe0f9f9
...
...
@@ -80,8 +80,9 @@ class ZopeCtlOptions(ZDOptions):
ZDOptions
.
realize
(
self
,
*
args
,
**
kw
)
config
=
self
.
configroot
self
.
directory
=
config
.
instancehome
self
.
clienthome
=
config
.
clienthome
self
.
program
=
[
os
.
path
.
join
(
self
.
directory
,
"bin"
,
"runzope"
)]
self
.
sockname
=
os
.
path
.
join
(
config
.
clienthome
,
"zopectlsock"
)
self
.
sockname
=
os
.
path
.
join
(
self
.
clienthome
,
"zopectlsock"
)
self
.
user
=
None
self
.
python
=
sys
.
executable
self
.
zdrun
=
os
.
path
.
join
(
os
.
path
.
dirname
(
zdaemon
.
__file__
),
...
...
@@ -123,6 +124,41 @@ class ZopeCmd(ZDCmd):
os
.
putenv
(
'ZMANAGED'
,
'1'
)
ZDCmd
.
do_start
(
self
,
arg
)
def
get_startup_cmd
(
self
,
python
,
more
):
cmdline
=
(
'%s -c "from Zope.Startup.options import ZopeOptions; '
'from Zope.Startup import handlers as h; '
'from App import config; '
'opts=ZopeOptions(); '
'opts.configfile=
\
'
%s
\
'
; '
'opts.realize(); '
'h.handleConfig(opts.configroot,opts.confighandlers);'
'config.setConfiguration(opts.configroot); '
%
(
python
,
self
.
options
.
configfile
)
)
return
cmdline
+
more
+
'
\
"
'
def
do_debug
(
self
,
arg
):
cmdline
=
self
.
get_startup_cmd
(
self
.
options
.
python
+
' -i'
,
'import Zope; app=Zope.app()'
)
print
(
'Starting debugger (the name "app" is bound to the top-level '
'Zope object)'
)
os
.
system
(
cmdline
)
def
help_debug
(
self
):
print
"debug -- run the Zope debugger to inspect your database"
print
" manually using a Python interactive shell"
def
do_run
(
self
,
arg
):
cmdline
=
self
.
get_startup_cmd
(
self
.
options
.
python
,
'import Zope; app=Zope.app(); execfile(
\
'
%s
\
'
)'
%
arg
)
os
.
system
(
cmdline
)
def
help_run
(
self
):
print
"run <script> -- run a Python script with the Zope environment"
print
" set up. The script can use the name 'app' to"
print
" access the top-level Zope object"
def
main
(
args
=
None
):
# This is exactly like zdctl.main(), but uses ZopeCtlOptions and
# ZopeCmd instead of ZDCtlOptions and ZDCmd, so the default values
...
...
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