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
c6713a93
Commit
c6713a93
authored
Jan 08, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zLOG -> logging
parent
077213b0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
19 deletions
+27
-19
lib/python/App/ApplicationManager.py
lib/python/App/ApplicationManager.py
+5
-5
lib/python/App/Hotfixes.py
lib/python/App/Hotfixes.py
+7
-4
lib/python/App/ProductContext.py
lib/python/App/ProductContext.py
+5
-4
lib/python/App/RefreshFuncs.py
lib/python/App/RefreshFuncs.py
+5
-4
lib/python/App/special_dtml.py
lib/python/App/special_dtml.py
+5
-2
No files found.
lib/python/App/ApplicationManager.py
View file @
c6713a93
...
...
@@ -15,6 +15,7 @@ __doc__="""System management components"""
__version__
=
'$Revision: 1.94 $'
[
11
:
-
2
]
import
sys
,
os
,
time
,
Globals
,
Acquisition
,
os
,
Undo
from
logging
import
getLogger
from
Globals
import
InitializeClass
from
Globals
import
DTMLFile
from
OFS.ObjectManager
import
ObjectManager
...
...
@@ -32,9 +33,10 @@ from AccessControl import getSecurityManager
from
zExceptions
import
Redirect
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
from
cgi
import
escape
import
zLOG
import
Lifetime
LOG
=
getLogger
(
'ApplicationManager'
)
try
:
import
thread
except
:
get_ident
=
lambda
:
0
else
:
get_ident
=
thread
.
get_ident
...
...
@@ -392,8 +394,7 @@ class ApplicationManager(Folder,CacheManager):
user
=
'"%s"'
%
getSecurityManager
().
getUser
().
getUserName
()
except
:
user
=
'unknown user'
zLOG
.
LOG
(
"ApplicationManager"
,
zLOG
.
INFO
,
"Restart requested by %s"
%
user
)
LOG
.
info
(
"Restart requested by %s"
%
user
)
#for db in Globals.opened: db.close()
Lifetime
.
shutdown
(
1
)
return
"""<html>
...
...
@@ -408,8 +409,7 @@ class ApplicationManager(Folder,CacheManager):
user
=
'"%s"'
%
getSecurityManager
().
getUser
().
getUserName
()
except
:
user
=
'unknown user'
zLOG
.
LOG
(
"ApplicationManager"
,
zLOG
.
INFO
,
"Shutdown requested by %s"
%
user
)
LOG
.
info
(
"Shutdown requested by %s"
%
user
)
#for db in Globals.opened: db.close()
Lifetime
.
shutdown
(
0
)
return
"""<html>
...
...
lib/python/App/Hotfixes.py
View file @
c6713a93
...
...
@@ -12,7 +12,10 @@
##############################################################################
from
version_txt
import
getZopeVersion
from
zLOG
import
LOG
,
INFO
,
WARNING
from
logging
import
getLogger
LOG
=
getLogger
(
'Hotfixes'
)
merged_hotfixes
=
{
'Hotfix_2001-09-28'
:
1
,
...
...
@@ -33,13 +36,13 @@ def isMerged(name):
def
logHotfix
(
id
,
apply_hotfix
):
if
apply_hotfix
:
LOG
(
'Hotfixes'
,
INFO
,
'Applying %s'
%
id
)
LOG
.
info
(
'Applying %s'
%
id
)
elif
apply_hotfix
is
OUTDATED_ZOPE
:
LOG
(
'Hotfixes'
,
WARNING
,
'Not applying %s. It is not designed for '
LOG
.
warn
(
'Not applying %s. It is not designed for '
'this version of Zope. Please uninstall the hotfix product.'
%
id
)
else
:
# ALREADY_MERGED
LOG
(
'Hotfixes'
,
WARNING
,
'Not applying %s. The fix has already been '
LOG
.
warn
(
'Not applying %s. The fix has already been '
'merged into Zope. Please uninstall the hotfix product.'
%
id
)
...
...
lib/python/App/ProductContext.py
View file @
c6713a93
...
...
@@ -15,8 +15,9 @@
$Id$
"""
import
os.path
,
re
import
stat
import
os.path
,
re
from
logging
import
getLogger
from
AccessControl.PermissionRole
import
PermissionRole
import
Globals
,
os
,
OFS
.
ObjectManager
,
OFS
.
misc_
,
Products
...
...
@@ -25,7 +26,7 @@ from App.Product import doInstall
from
HelpSys
import
HelpTopic
,
APIHelpTopic
from
HelpSys.HelpSys
import
ProductHelp
from
FactoryDispatcher
import
FactoryDispatcher
from
zLOG
import
LOG
,
WARNING
from
DateTime
import
DateTime
from
Interface.Implements
import
instancesOfObjectImplements
from
zope.interface
import
implementedBy
...
...
@@ -39,7 +40,7 @@ if not hasattr(Products, 'meta_classes'):
Products
.
meta_class_info
=
{}
_marker
=
[]
# Create a new marker object
LOG
=
getLogger
(
'ProductContext'
)
class
ProductContext
:
...
...
@@ -312,7 +313,7 @@ class ProductContext:
try
:
dir_mod_time
=
DateTime
(
os
.
stat
(
path
)[
stat
.
ST_MTIME
])
except
OSError
,
(
errno
,
text
):
LOG
(
"Zope"
,
WARNING
,
'%s: %s'
%
(
text
,
path
))
LOG
.
warn
(
'%s: %s'
%
(
text
,
path
))
return
# test to see if nothing has changed since last registration
...
...
lib/python/App/RefreshFuncs.py
View file @
c6713a93
...
...
@@ -17,12 +17,14 @@ $Id$
import
os
,
sys
from
time
import
time
from
traceback
import
format_exception
from
logging
import
getLogger
import
transaction
import
Products
from
ExtensionClass
import
Base
from
Globals
import
PersistentMapping
from
zLOG
import
format_exception
,
LOG
,
ERROR
,
INFO
LOG
=
getLogger
(
'RefreshFuncs'
)
global_classes_timestamp
=
0
products_mod_times
=
{}
...
...
@@ -136,8 +138,7 @@ def listRefreshableModules(productid):
def
logBadRefresh
(
productid
):
exc
=
sys
.
exc_info
()
try
:
LOG
(
'Refresh'
,
ERROR
,
'Exception while refreshing %s'
%
productid
,
error
=
exc
)
LOG
.
error
(
'Exception while refreshing %s'
%
productid
,
exc_info
=
exc
)
if
hasattr
(
exc
[
0
],
'__name__'
):
error_type
=
exc
[
0
].
__name__
else
:
...
...
@@ -179,7 +180,7 @@ def performRefresh(jar, productid):
def
performSafeRefresh
(
jar
,
productid
):
try
:
LOG
(
'Refresh'
,
INFO
,
'Refreshing product %s'
%
productid
)
LOG
.
info
(
'Refreshing product %s'
%
productid
)
if
not
performRefresh
(
jar
,
productid
):
return
0
except
:
...
...
lib/python/App/special_dtml.py
View file @
c6713a93
...
...
@@ -13,9 +13,12 @@
import
DocumentTemplate
,
Common
,
Persistence
,
MethodObject
,
Globals
,
os
,
sys
from
types
import
InstanceType
from
zLOG
import
LOG
,
WARNING
from
logging
import
getLogger
from
App.config
import
getConfiguration
LOG
=
getLogger
(
'special_dtml'
)
class
HTML
(
DocumentTemplate
.
HTML
,
Persistence
.
Persistent
,):
"Persistent HTML Document Templates"
...
...
@@ -176,7 +179,7 @@ class DTMLFile(Bindings, Explicit, ClassicHTMLFile):
except
DTReturn
,
v
:
result
=
v
.
v
except
AttributeError
:
if
type
(
sys
.
exc_value
)
==
InstanceType
and
sys
.
exc_value
.
args
[
0
]
==
"_v_blocks"
:
LOG
(
"ZPublisher"
,
WARNING
,
"DTML file '%s' could not be read"
%
self
.
raw
)
LOG
.
warn
(
"DTML file '%s' could not be read"
%
self
.
raw
)
raise
ValueError
,
(
"DTML file error: "
"Check logfile for details"
)
else
:
...
...
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