[Zope-CVS] CVS: Zope - w_pcgi.py:1.7 wo_pcgi.py:1.25 z2.py:1.82 zpasswd.py:1.17
Martijn Pieters
mj@zope.com
Wed, 14 Aug 2002 17:11:39 -0400
Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv7174
Modified Files:
w_pcgi.py wo_pcgi.py z2.py zpasswd.py
Log Message:
Clean up indentation and trailing whitespace.
=== Zope/w_pcgi.py 1.6 => 1.7 ===
--- Zope/w_pcgi.py:1.6 Wed Nov 28 10:50:49 2001
+++ Zope/w_pcgi.py Wed Aug 14 17:11:39 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""Try to do all of the installation steps.
@@ -28,7 +28,7 @@
def main(me):
home=setup(me)
-
+
import build_pcgi
user=group=''
pcgi=os.path.join(home, 'Zope.cgi')
=== Zope/wo_pcgi.py 1.24 => 1.25 ===
--- Zope/wo_pcgi.py:1.24 Wed Nov 28 10:50:49 2001
+++ Zope/wo_pcgi.py Wed Aug 14 17:11:39 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""Try to do all of the installation steps.
@@ -33,7 +33,7 @@
import build_extensions
user=group=''
import default_content; default_content.main(home, user, group)
-
+
pcgi=os.path.join(home, 'Zope.cgi')
import make_start; make_start.sh(home, user, group)
import zpasswd; zpasswd.write_inituser(home, user, group)
=== Zope/z2.py 1.81 => 1.82 ===
--- Zope/z2.py:1.81 Fri Aug 9 12:38:30 2002
+++ Zope/z2.py Wed Aug 14 17:11:39 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""Zope 2 ZServer start-up file
@@ -69,9 +69,9 @@
(e.g. -d ''), then IP addresses will not be logged. If you have
DNS service on your local machine then you can set this to
127.0.0.1. The default is: %(DNS_IP)s.
-
+
-u username or uid number
-
+
The username to run ZServer as. You may want to run ZServer as
a dedicated user. This only works under Unix, and if ZServer
is started as root, and is required in that case.
@@ -88,9 +88,9 @@
to listen on different addresses.
Multiple -P options can be provided to run multiple sets of servers.
-
+
-w port
-
+
The Web server (HTTP) port. This defaults to %(HTTP_PORT)s. The
standard port for HTTP services is 80. If this is a dash
(e.g. -w -), then HTTP is disabled.
@@ -102,7 +102,7 @@
Multiple -w options can be provided to run multiple servers.
-W port
-
+
The "WebDAV source" port. If this is a dash (e.g. -w -), then
"WebDAV source" is disabled. The default is disabled. Note that
this feature is a workaround for the lack of "source-link" support
@@ -122,7 +122,7 @@
the client.
-f port
-
+
The FTP port. If this is a dash (e.g. -f -), then FTP
is disabled. The standard port for FTP services is 21. The
default is %(FTP_PORT)s.
@@ -146,7 +146,7 @@
not specified then the FastCGI Server is disabled.
-m port
-
+
The secure monitor server port. If this is a dash
(-m -), then the monitor server is disabled. The monitor server
allows interactive Python style access to a running ZServer. To
@@ -177,17 +177,17 @@
Path to the ZServer log file. If this is a relative path then the
log file will be written to the 'var' directory. The default is
- %(LOG_FILE)s.
+ %(LOG_FILE)s.
-r
-
+
Run ZServer is read-only mode. ZServer won't write anything to disk.
No log files, no pid files, nothing. This means that you can't do a
lot of stuff like use PCGI, and zdaemon. ZServer will log hits to
STDOUT and zLOG will log to STDERR.
-L
-
+
Enable locale (internationalization) support. The value passed for
this option should be the name of the locale to be used (see your
operating system documentation for locale information specific to
@@ -207,7 +207,7 @@
web server:
%(program)s -X -w80
-
+
-M file
Save detailed logging information to the given file.
@@ -348,8 +348,8 @@
a=IP_ADDRESS
if not v: return v
-
- try:
+
+ try:
v=int(v)
if v < 0: raise 'Invalid port', v
v=v+offset
@@ -358,8 +358,8 @@
if isinstance(old, IntType): old=[(a,v)]
else: old.append((a,v))
- return old
-
+ return old
+
try:
python_version = sys.version.split()[0]
@@ -376,12 +376,12 @@
python_version)
warnings.warn(err)
if python_version[:3] == '2.2':
- import warnings
- err = ('You are running Python version %s. This Python version '
- 'has not yet been tested with Zope and you may experience '
- 'operational problems as a result. Consider using '
- 'Python 2.1.3 instead.' % python_version)
- warnings.warn(err)
+ import warnings
+ err = ('You are running Python version %s. This Python version '
+ 'has not yet been tested with Zope and you may experience '
+ 'operational problems as a result. Consider using '
+ 'Python 2.1.3 instead.' % python_version)
+ warnings.warn(err)
opts, args = getopt.getopt(sys.argv[1:],
@@ -391,16 +391,16 @@
DEBUG=0
READ_ONLY=0
-
+
# Get environment variables
for a in args:
if a.find('='):
a=a.split('=')
o=a[0]
v='='.join(a[1:])
- if o:
- os.environ[o]=v
- HTTP_ENV[o]=v
+ if o:
+ os.environ[o]=v
+ HTTP_ENV[o]=v
else:
raise 'Invalid argument', a
@@ -657,7 +657,7 @@
# environment setting is useful when you want to proxy requests
# from another web server to ZServer, and would like the CGI
# environment to reflect the CGI environment of the other web
- # server.
+ # server.
zh = zhttp_handler(MODULE, '', HTTP_ENV)
if FORCE_HTTP_CONNECTION_CLOSE:
zh._force_connection_close = 1
@@ -691,11 +691,11 @@
# environment setting is useful when you want to proxy requests
# from another web server to ZServer, and would like the CGI
# environment to reflect the CGI environment of the other web
- # server.
+ # server.
zh = WebDAVSrcHandler(MODULE, '', HTTP_ENV)
hs.install_handler(zh)
- # enable document retrieval of the document source on the
+ # enable document retrieval of the document source on the
# standard HTTP port
clients = os.environ.get('WEBDAV_SOURCE_PORT_CLIENTS')
@@ -769,7 +769,7 @@
zLOG.LOG("z2", zLOG.WARNING, 'Monitor server not started'
' because no emergency user exists.')
if pw:
- if isinstance(MONITOR_PORT, IntType):
+ if isinstance(MONITOR_PORT, IntType):
MONITOR_PORT=((IP_ADDRESS, MONITOR_PORT),)
for address, port in MONITOR_PORT:
try:
@@ -852,7 +852,7 @@
gid = pwd.getpwuid(UID)[3]
UID = pwd.getpwuid(UID)[0]
else:
- raise KeyError
+ raise KeyError
if UID == 'nobody':
_warn_nobody()
try:
@@ -877,7 +877,7 @@
# umask is silly, blame POSIX. We have to set it to get its value.
current_umask = os.umask(0)
os.umask(current_umask)
- if current_umask != 077:
+ if current_umask != 077:
current_umask = '%03o' % current_umask
zLOG.LOG("z2", zLOG.INFO, (
'Your umask of %s may be too permissive; for the security of '
=== Zope/zpasswd.py 1.16 => 1.17 ===
--- Zope/zpasswd.py:1.16 Wed May 22 21:01:45 2002
+++ Zope/zpasswd.py Wed Aug 14 17:11:39 2002
@@ -2,14 +2,14 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""Zope user bootstrap system"""
@@ -52,7 +52,7 @@
acfile.close()
os.system('chmod 644 %s' % ac_path)
return pw
-
+
def write_access(home, user='', group=''):
ac_path=os.path.join(home, 'access')
if not os.path.exists(ac_path):
@@ -111,17 +111,17 @@
-d / --domains=
Set the domain names that the user user can log in from. Defaults to
any. OPTIONAL.
-
+
Filename is required and should be the name of the file to store the
information in (usually "inituser" or "access").
-
+
Copyright (C) 1999, 2000 Digital Creations, Inc.
""" % argv[0]
try:
if len(argv) < 2:
raise "CommandLineError"
-
+
optlist, args = getopt.getopt(sys.argv[1:], short_options, long_options)
if len(args) != 1:
@@ -134,7 +134,7 @@
username = ''
encoding = 'SHA'
domains = ''
-
+
for opt in optlist:
if (opt[0] == '-u') or (opt[0] == '--username'):
username = opt[1]
@@ -159,7 +159,7 @@
username = raw_input("Username: ")
if username != '':
break
-
+
while 1:
password = getpass.getpass("Password: ")
verify = getpass.getpass("Verify password: ")
@@ -190,12 +190,11 @@
access_file.write(username + ":" +
generate_passwd(password, encoding) +
domains)
-
+
except "CommandLineError":
sys.stderr.write(usage)
sys.exit(1)
-
+
# If called from the command line
if __name__=='__main__': main(sys.argv)
-