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