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
539a73ad
Commit
539a73ad
authored
Oct 05, 2009
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make "zopectl fg" work on Windows by borrowing from plone.recipe.zope2instance
parent
33cff5ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
src/Zope2/Startup/zopectl.py
src/Zope2/Startup/zopectl.py
+24
-12
No files found.
src/Zope2/Startup/zopectl.py
View file @
539a73ad
...
@@ -90,6 +90,17 @@ if sys.platform[:3].lower() == "win":
...
@@ -90,6 +90,17 @@ if sys.platform[:3].lower() == "win":
def
string_list
(
arg
):
def
string_list
(
arg
):
return
arg
.
split
()
return
arg
.
split
()
def
quote_command
(
command
):
print
" "
.
join
(
command
)
# Quote the program name, so it works even if it contains spaces
command
=
" "
.
join
([
'"%s"'
%
x
for
x
in
command
])
if
WIN
:
# odd, but true: the windows cmd processor can't handle more than
# one quoted item per string unless you add quotes around the
# whole line.
command
=
'"%s"'
%
command
return
command
class
ZopeCtlOptions
(
ZDOptions
):
class
ZopeCtlOptions
(
ZDOptions
):
# Zope controller options.
# Zope controller options.
#
#
...
@@ -266,18 +277,19 @@ class ZopeCmd(ZDCmd):
...
@@ -266,18 +277,19 @@ class ZopeCmd(ZDCmd):
os
.
system
(
cmdline
)
os
.
system
(
cmdline
)
def
do_foreground
(
self
,
arg
):
def
do_foreground
(
self
,
arg
):
if
WIN
:
program
=
self
.
options
.
program
# Adding arguments to the program is not supported on Windows
local_additions
=
[]
# and the runzope script doesn't put you in debug-mode either
if
not
program
.
count
(
'-X'
):
ZDCmd
.
do_foreground
(
self
,
arg
)
local_additions
+=
[
'-X'
]
else
:
if
not
program
.
count
(
'debug-mode=on'
):
self
.
options
.
program
[
1
:
1
]
=
[
"-X"
,
"debug-mode=on"
]
local_additions
+=
[
'debug-mode=on'
]
try
:
program
[
1
:
1
]
=
local_additions
ZDCmd
.
do_foreground
(
self
,
arg
)
command
=
quote_command
(
program
)
finally
:
try
:
self
.
options
.
program
.
remove
(
"-X"
)
return
os
.
system
(
command
)
self
.
options
.
program
.
remove
(
"debug-mode=on"
)
finally
:
for
addition
in
local_additions
:
program
.
remove
(
addition
)
def
help_debug
(
self
):
def
help_debug
(
self
):
print
"debug -- run the Zope debugger to inspect your database"
print
"debug -- run the Zope debugger to inspect your database"
print
" manually using a Python interactive shell"
print
" manually using a Python interactive shell"
...
...
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