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
c3fbdacf
Commit
c3fbdacf
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
149eb603
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
23 deletions
+20
-23
lib/python/Main.py
lib/python/Main.py
+2
-2
lib/python/ZClasses/Basic.py
lib/python/ZClasses/Basic.py
+0
-1
lib/python/ZClasses/Method.py
lib/python/ZClasses/Method.py
+7
-8
lib/python/ZClasses/Property.py
lib/python/ZClasses/Property.py
+3
-4
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+4
-4
lib/python/ZLogger/stupidFileLogger.py
lib/python/ZLogger/stupidFileLogger.py
+2
-2
lib/python/ZLogger/syslogLogger.py
lib/python/ZLogger/syslogLogger.py
+2
-2
No files found.
lib/python/Main.py
View file @
c3fbdacf
...
...
@@ -27,7 +27,7 @@ The Job of this module is to:
# versions of Persistent etc get registered.
from
BoboPOS
import
SimpleDB
,
TJar
,
SingleThreadedTransaction
import
sys
,
os
,
string
,
Globals
,
OFS
.
Application
import
sys
,
os
,
Globals
,
OFS
.
Application
Globals
.
BobobaseName
=
os
.
path
.
join
(
Globals
.
data_dir
,
'Data.bbb'
)
Globals
.
DatabaseVersion
=
'2'
...
...
@@ -63,7 +63,7 @@ bobo_application=app
OFS
.
Application
.
initialize
(
app
)
if
os
.
environ
.
has_key
(
'ZOPE_DATABASE_QUOTA'
):
quota
=
string
.
atoi
(
os
.
environ
[
'ZOPE_DATABASE_QUOTA'
])
quota
=
int
(
os
.
environ
[
'ZOPE_DATABASE_QUOTA'
])
Bobobase
.
_jar
.
db
.
set_quota
(
lambda
x
,
quota
=
quota
,
otherdb
=
VersionBase
.
TDB
:
x
+
otherdb
.
pos
>
quota
)
...
...
lib/python/ZClasses/Basic.py
View file @
c3fbdacf
...
...
@@ -14,7 +14,6 @@
"""
import
Globals
,
OFS
.
PropertySheets
,
OFS
.
Image
,
ExtensionClass
from
string
import
split
,
join
,
strip
import
Acquisition
,
Products
class
ZClassBasicSheet
(
OFS
.
PropertySheets
.
PropertySheet
,
...
...
lib/python/ZClasses/Method.py
View file @
c3fbdacf
...
...
@@ -15,7 +15,6 @@
import
Acquisition
,
ExtensionClass
,
Globals
,
OFS
.
PropertySheets
,
OFS
.
Folder
from
AccessControl.Permission
import
pname
from
string
import
strip
import
App.Dialogs
,
ZClasses
,
App
.
Factory
,
App
.
Product
,
App
.
ProductRegistry
import
ZClassOwner
from
AccessControl.PermissionMapping
import
aqwrap
,
PermissionMapper
...
...
@@ -121,26 +120,26 @@ class ZClassMethodsSheet(
return
id
+
' '
def
_setOb
(
self
,
id
,
object
):
self
.
setClassAttr
(
strip
(
id
),
MWp
(
object
))
self
.
setClassAttr
(
id
.
strip
(
),
MWp
(
object
))
def
_delOb
(
self
,
id
):
self
.
delClassAttr
(
strip
(
id
))
self
.
delClassAttr
(
id
.
strip
(
))
def
_delObject
(
self
,
id
,
dp
=
1
):
# Ick! This is necessary to deal with spaces. Waaa!
object
=
self
.
_getOb
(
id
)
object
.
manage_beforeDelete
(
object
,
self
)
id
=
strip
(
id
)
id
=
id
.
strip
(
)
self
.
_objects
=
tuple
(
filter
(
lambda
i
,
n
=
id
:
strip
(
i
[
'id'
]
)
!=
n
,
i
[
'id'
].
strip
(
)
!=
n
,
self
.
_objects
))
self
.
_delOb
(
id
)
def
_getOb
(
self
,
id
,
default
=
_marker
):
if
default
is
_marker
:
r
=
self
.
getClassAttr
(
strip
(
id
))
r
=
self
.
getClassAttr
(
id
.
strip
(
))
else
:
try
:
r
=
self
.
getClassAttr
(
strip
(
id
))
try
:
r
=
self
.
getClassAttr
(
id
.
strip
(
))
except
:
return
default
if
hasattr
(
r
,
methodattr
):
...
...
@@ -157,7 +156,7 @@ class ZClassMethodsSheet(
m
.
_permissionMapper
=
wrapper
mw
=
MWp
(
m
)
self
.
setClassAttr
(
strip
(
id
),
mw
)
self
.
setClassAttr
(
id
.
strip
(
),
mw
)
r
=
m
...
...
lib/python/ZClasses/Property.py
View file @
c3fbdacf
...
...
@@ -15,7 +15,6 @@
import
OFS.PropertySheets
,
Globals
,
OFS
.
SimpleItem
,
OFS
.
PropertyManager
import
Acquisition
from
string
import
join
,
upper
from
AccessControl.Permission
import
pname
class
ClassCaretaker
:
...
...
@@ -89,7 +88,7 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item):
a
=
r
.
append
for
p
in
self
.
propertyMap
():
pid
=
p
[
'id'
]
pid
=
upper
(
pid
[:
1
]
)
+
pid
[
1
:]
pid
=
pid
[:
1
].
upper
(
)
+
pid
[
1
:]
a
(
' <tr><th align=left valign=top>%s</th>'
%
pid
)
a
(
' <td align=left valign=top>%s</td>'
%
self
.
_view_widget_for_type
(
p
[
'type'
],
p
[
'id'
])
...
...
@@ -97,7 +96,7 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item):
a
(
' </tr>'
)
a
(
'</table>'
)
a
(
'<dtml-var standard_html_footer>'
)
r
=
join
(
r
,
'
\
n
'
)
r
=
'
\
n
'
.
join
(
r
)
self
.
aq_parent
.
aq_parent
.
methods
.
manage_addDTMLMethod
(
id
,
title
,
r
)
if
REQUEST
is
not
None
:
REQUEST
[
'RESPONSE'
].
redirect
(
REQUEST
[
'URL3'
]
+
'/methods/manage'
)
...
...
@@ -185,7 +184,7 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item):
a
(
' </td></tr>'
)
a
(
'</table></form>'
)
a
(
'</body></html>'
)
r
=
join
(
r
,
'
\
n
'
)
r
=
'
\
n
'
.
join
(
r
)
self
.
aq_parent
.
aq_parent
.
methods
.
manage_addDTMLMethod
(
id
,
title
,
r
)
if
REQUEST
is
not
None
:
REQUEST
[
'RESPONSE'
].
redirect
(
REQUEST
[
'URL3'
]
+
'/methods/manage'
)
...
...
lib/python/ZClasses/ZClass.py
View file @
c3fbdacf
...
...
@@ -12,7 +12,7 @@
##############################################################################
"""Zope Classes
"""
import
Globals
,
string
,
OFS
.
SimpleItem
,
OFS
.
PropertySheets
,
Products
import
Globals
,
OFS
.
SimpleItem
,
OFS
.
PropertySheets
,
Products
import
Method
,
Basic
,
Property
,
AccessControl
.
Role
,
re
from
ZPublisher.mapply
import
mapply
...
...
@@ -73,9 +73,9 @@ def createZClassForBase( base_class, pack, nice_name=None, meta_type=None ):
key
=
"%s/%s"
%
(
base_module
,
base_name
)
if
base_module
[:
9
]
==
'Products.'
:
base_module
=
string
.
split
(
base_module
,
'.'
)[
1
]
base_module
=
base_module
.
split
(
'.'
)[
1
]
else
:
base_module
=
string
.
split
(
base_module
,
'.'
)[
0
]
base_module
=
base_module
.
split
(
'.'
)[
0
]
info
=
"%s: %s"
%
(
base_module
,
base_name
)
...
...
@@ -331,7 +331,7 @@ class ZClass( Base
id
.
update
(
self
.
absolute_url
())
id
.
update
(
str
(
time
.
time
()))
id
=
id
.
digest
()
id
=
string
.
strip
(
base64
.
encodestring
(
id
)
)
id
=
base64
.
encodestring
(
id
).
strip
(
)
return
'*'
+
id
...
...
lib/python/ZLogger/stupidFileLogger.py
View file @
c3fbdacf
...
...
@@ -10,7 +10,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import
time
,
sys
,
string
,
os
,
thread
import
time
,
sys
,
os
,
thread
from
zLOG
import
severity_string
,
log_time
,
format_exception
...
...
@@ -49,7 +49,7 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
global
_stupid_severity
if
_stupid_severity
is
None
:
try
:
_stupid_severity
=
string
.
atoi
(
os
.
environ
[
'STUPID_LOG_SEVERITY'
])
try
:
_stupid_severity
=
int
(
os
.
environ
[
'STUPID_LOG_SEVERITY'
])
except
:
_stupid_severity
=
0
if
severity
<
_stupid_severity
:
return
...
...
lib/python/ZLogger/syslogLogger.py
View file @
c3fbdacf
...
...
@@ -13,7 +13,7 @@
from
syslog
import
syslog_client
,
LOG_ALERT
,
LOG_ERR
,
LOG_WARNING
,
LOG_NOTICE
from
syslog
import
LOG_INFO
,
LOG_DEBUG
import
os
,
string
,
traceback
import
os
,
traceback
pid_str
=
'[%s]: '
%
os
.
getpid
()
...
...
@@ -23,7 +23,7 @@ class syslogLogger:
def
__init__
(
self
):
if
os
.
environ
.
has_key
(
'ZSYSLOG_SERVER'
):
(
addr
,
port
)
=
string
.
split
(
os
.
environ
[
'ZSYSLOG_SERVER'
],
':'
)
(
addr
,
port
)
=
os
.
environ
[
'ZSYSLOG_SERVER'
].
split
(
':'
)
self
.
client
=
syslog_client
((
addr
,
int
(
port
)))
self
.
on
=
1
elif
os
.
environ
.
has_key
(
'ZSYSLOG'
):
...
...
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