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
6119c7fa
Commit
6119c7fa
authored
Sep 14, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added minimal locale support as a command line option to z2.py.
parent
98455762
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
6 deletions
+52
-6
z2.py
z2.py
+52
-6
No files found.
z2.py
View file @
6119c7fa
...
...
@@ -175,10 +175,6 @@ Options:
same as the Zope super manager password set in the 'access'
file. The default is %(MONITOR_PORT)s.
-2
Use ZODB 2 (aka BoboPOS) rather than ZODB 3
-l path
Path to the ZServer log file. If this is a relative path then the
...
...
@@ -192,6 +188,19 @@ Options:
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
your system). If an empty string is passed for this option (-L ''),
Zope will set the locale to the user's default setting (typically
specified in the $LANG environment variable). If your Python
installation does not support the locale module, the requested
locale is not supported by your system or an empty string was
passed but no default locale can be found, an error will be raised
and Zope will not start.
Environment settings are of the form: NAME=VALUE.
...
...
@@ -259,6 +268,11 @@ MODULE='Zope'
# The size of the thread pool, if ZODB3 is used.
NUMBER_OF_THREADS
=
4
# Localization support
LOCALE_ID
=
None
#
########################################################################
...
...
@@ -269,7 +283,7 @@ try:
if
string
.
split
(
sys
.
version
)[
0
]
<
'1.5.2'
:
raise
'Invalid python version'
,
string
.
split
(
sys
.
version
)[
0
]
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hz:Z:t:a:d:u:w:f:p:m:Sl:2DP:r'
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hz:Z:t:a:d:u:w:f:p:m:Sl:2DP:r
L:
'
)
DEBUG
=
0
READ_ONLY
=
0
...
...
@@ -334,6 +348,9 @@ try:
sys
.
exit
(
0
)
elif
o
==
'-2'
:
MODULE
=
'Main'
elif
o
==
'-l'
:
LOG_FILE
=
v
elif
o
==
'-L'
:
if
v
:
LOCALE_ID
=
v
else
:
LOCALE_ID
=
''
__builtins__
.
__debug__
=
DEBUG
...
...
@@ -358,6 +375,35 @@ sys.path=[os.path.join(here,'lib','python'),here
]
+
filter
(
None
,
sys
.
path
)
# Try to set the locale if specified on the command
# line. If the locale module is not available or the
# requested locale is not supported by the local
# machine, raise an error so that the user is made
# aware of the problem.
def
set_locale
(
val
):
try
:
import
locale
except
:
raise
SystemExit
,
(
'The locale module could not be imported.
\
n
'
\
'To use localization options, you must ensure
\
n
'
\
'that the locale module is compiled into your
\
n
'
\
'Python installation.'
)
try
:
locale
.
setlocale
(
locale
.
LC_ALL
,
val
)
except
:
raise
SystemExit
,
(
'The specified locale is not supported by your system.
\
n
'
\
'See your operating system documentation for more
\
n
'
\
'information on locale support.'
)
if
LOCALE_ID
is
not
None
:
set_locale
(
LOCALE_ID
)
# from this point forward we can use the zope logger
# Import ZServer before we open the database or get at interesting
...
...
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