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
b22186c3
Commit
b22186c3
authored
Feb 07, 2002
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced string module calls by string methods
parent
85579311
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
22 deletions
+21
-22
lib/python/Zope/ClassFactory.py
lib/python/Zope/ClassFactory.py
+0
-1
lib/python/Zope/__init__.py
lib/python/Zope/__init__.py
+5
-5
z2.py
z2.py
+13
-13
zpasswd.py
zpasswd.py
+3
-3
No files found.
lib/python/Zope/ClassFactory.py
View file @
b22186c3
...
...
@@ -12,7 +12,6 @@
##############################################################################
"""Zope Framework Class Finder
"""
from
string
import
strip
import
OFS.Uninstalled
def
ClassFactory
(
jar
,
module
,
name
,
...
...
lib/python/Zope/__init__.py
View file @
b22186c3
...
...
@@ -84,7 +84,7 @@ AccessControl.SecurityManagement.noSecurityManager()
# This is sneaky, but we don't want to play with Main:
sys
.
modules
[
'Main'
]
=
sys
.
modules
[
'Zope'
]
import
ZODB.POSException
,
ZPublisher
,
string
,
ZPublisher
import
ZODB.POSException
,
ZPublisher
,
ZPublisher
import
ExtensionClass
from
zLOG
import
LOG
,
WARNING
,
INFO
,
BLATHER
,
log_time
conflict_errors
=
0
...
...
@@ -179,13 +179,13 @@ class TransactionsManager:
def
recordMetaData
(
self
,
object
,
request
,
# Optimize global var lookups:
hasattr
=
hasattr
,
join
=
string
.
join
,
getattr
=
getattr
,
hasattr
=
hasattr
,
getattr
=
getattr
,
get_transaction
=
get_transaction
,
LOG
=
LOG
,
WARNING
=
WARNING
,
):
request_get
=
request
.
get
if
hasattr
(
object
,
'getPhysicalPath'
):
path
=
join
(
object
.
getPhysicalPath
(),
'/'
)
path
=
'/'
.
join
(
object
.
getPhysicalPath
()
)
else
:
# Try hard to get the physical path of the object,
# but there are many circumstances where that's not possible.
...
...
@@ -206,7 +206,7 @@ class TransactionsManager:
object
=
getattr
(
object
,
'aq_parent'
,
None
)
if
object
is
not
None
:
path
=
join
(
object
.
getPhysicalPath
()
+
to_append
,
'/'
)
path
=
'/'
.
join
(
object
.
getPhysicalPath
()
+
to_append
)
else
:
# As Jim would say, "Waaaaaaaa!"
# This may cause problems with virtual hosts
...
...
@@ -228,7 +228,7 @@ class TransactionsManager:
%
str
(
type
(
auth_user
)))
auth_path
=
request_get
(
'AUTHENTICATION_PATH'
)
else
:
auth_path
=
join
(
auth_folder
.
getPhysicalPath
()[
1
:
-
1
],
'/'
)
auth_path
=
'/'
.
join
(
auth_folder
.
getPhysicalPath
()[
1
:
-
1
]
)
T
.
setUser
(
auth_user
,
auth_path
)
...
...
z2.py
View file @
b22186c3
...
...
@@ -221,7 +221,7 @@ if swhome != 'INSERT_SOFTWARE_HOME':
sys
.
path
.
insert
(
5
,
'%s'
%
swhome
)
import
os
,
sys
,
getopt
,
string
import
os
,
sys
,
getopt
sys
.
setcheckinterval
(
120
)
...
...
@@ -311,7 +311,7 @@ DETAILED_LOG_FILE=''
def
server_info
(
old
,
v
,
offset
=
0
):
# interpret v as a port or address/port and get new value
if
v
==
'-'
:
v
=
''
l
=
string
.
find
(
v
,
':'
)
l
=
v
.
find
(
':'
)
if
l
>=
0
:
a
=
v
[:
l
]
v
=
v
[
l
+
1
:]
...
...
@@ -321,7 +321,7 @@ def server_info(old, v, offset=0):
if
not
v
:
return
v
try
:
v
=
string
.
atoi
(
v
)
v
=
int
(
v
)
if
v
<
0
:
raise
'Invalid port'
,
v
v
=
v
+
offset
except
:
raise
'Invalid port'
,
v
...
...
@@ -333,8 +333,8 @@ def server_info(old, v, offset=0):
try
:
if
s
tring
.
split
(
sys
.
version
)[
0
]
<
'2.1'
:
raise
'Invalid python version'
,
s
tring
.
split
(
sys
.
version
)[
0
]
if
s
ys
.
version
.
split
(
)[
0
]
<
'2.1'
:
raise
'Invalid python version'
,
s
ys
.
version
.
split
(
)[
0
]
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hz:Z:t:i:a:d:u:w:W:f:p:m:Sl:2DP:rF:L:XM:'
)
...
...
@@ -344,10 +344,10 @@ try:
# Get environment variables
for
a
in
args
:
if
string
.
find
(
a
,
'='
):
a
=
string
.
split
(
a
,
'='
)
if
a
.
find
(
'='
):
a
=
a
.
split
(
'='
)
o
=
a
[
0
]
v
=
string
.
join
(
a
[
1
:],
'='
)
v
=
'='
.
join
(
a
[
1
:]
)
if
o
:
os
.
environ
[
o
]
=
v
HTTP_ENV
[
o
]
=
v
...
...
@@ -361,12 +361,12 @@ try:
Zpid
=
v
elif
o
==
'-r'
:
READ_ONLY
=
1
elif
o
==
'-t'
:
try
:
v
=
string
.
atoi
(
v
)
try
:
v
=
int
(
v
)
except
:
raise
'Invalid number of threads'
,
v
NUMBER_OF_THREADS
=
v
elif
o
==
'-i'
:
try
:
v
=
string
.
atoi
(
v
)
try
:
v
=
int
(
v
)
except
:
raise
'Invalid value for -i option'
,
v
sys
.
setcheckinterval
(
v
)
...
...
@@ -540,7 +540,7 @@ try:
else
:
lg
=
logger
.
syslog_logger
(
os
.
environ
[
'ZSYSLOG'
])
elif
os
.
environ
.
has_key
(
'ZSYSLOG_SERVER'
):
(
addr
,
port
)
=
string
.
split
(
os
.
environ
[
'ZSYSLOG_SERVER'
],
':'
)
(
addr
,
port
)
=
os
.
environ
[
'ZSYSLOG_SERVER'
].
split
(
':'
)
lg
=
logger
.
syslog_logger
((
addr
,
int
(
port
)))
else
:
lg
=
logger
.
file_logger
(
LOG_PATH
)
...
...
@@ -621,7 +621,7 @@ try:
fcgiPort
=
None
fcgiPath
=
None
try
:
fcgiPort
=
string
.
atoi
(
FCGI_PORT
)
fcgiPort
=
int
(
FCGI_PORT
)
except
ValueError
:
fcgiPath
=
FCGI_PORT
zfcgi
=
FCGIServer
(
module
=
MODULE
,
...
...
@@ -656,7 +656,7 @@ try:
try
:
import
pwd
try
:
try
:
UID
=
string
.
atoi
(
UID
)
try
:
UID
=
int
(
UID
)
except
:
pass
gid
=
None
if
type
(
UID
)
==
type
(
""
):
...
...
zpasswd.py
View file @
b22186c3
...
...
@@ -13,9 +13,9 @@
##############################################################################
"""Zope user bootstrap system"""
__version__
=
'$Revision: 1.1
3
$ '
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
4
$ '
[
11
:
-
2
]
import
sys
,
string
,
sha
,
binascii
,
whrandom
,
getopt
,
getpass
,
os
import
sys
,
sha
,
binascii
,
whrandom
,
getopt
,
getpass
,
os
try
:
from
crypt
import
crypt
...
...
@@ -30,7 +30,7 @@ def generate_salt():
return
whrandom
.
choice
(
salt_choices
)
+
whrandom
.
choice
(
salt_choices
)
def
generate_passwd
(
password
,
encoding
):
encoding
=
string
.
upper
(
encoding
)
encoding
=
encoding
.
upper
(
)
if
encoding
==
'SHA'
:
pw
=
'{SHA}'
+
binascii
.
b2a_base64
(
sha
.
new
(
password
).
digest
())[:
-
1
]
elif
encoding
==
'CRYPT'
:
...
...
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