Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
4636fbdd
Commit
4636fbdd
authored
Nov 06, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove warnfilter options (move to Zope.Startup).
parent
7550974d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
36 deletions
+0
-36
trunk/src/zLOG/component.xml
trunk/src/zLOG/component.xml
+0
-8
trunk/src/zLOG/datatypes.py
trunk/src/zLOG/datatypes.py
+0
-28
No files found.
trunk/src/zLOG/component.xml
View file @
4636fbdd
...
...
@@ -58,12 +58,4 @@
<multisection
type=
"zLOG.loghandler"
attribute=
"handlers"
name=
"*"
/>
</sectiontype>
<sectiontype
name=
"warnfilter"
datatype=
".warning_filter_handler"
>
<key
name=
"action"
datatype=
".warn_action"
default=
"default"
/>
<key
name=
"message"
default=
""
/>
<key
name=
"category"
datatype=
".warning_subclass"
default=
"Warning"
/>
<key
name=
"module"
default=
""
/>
<key
name=
"lineno"
datatype=
"integer"
default=
"0"
/>
</sectiontype>
</component>
trunk/src/zLOG/datatypes.py
View file @
4636fbdd
...
...
@@ -257,31 +257,3 @@ def importable_name(name):
except
ImportError
:
raise
ValueError
,
(
'The object named by "%s" could not be imported'
%
name
)
def
warning_subclass
(
val
):
ob
=
importable_name
(
val
)
# will fail in course
try
:
if
not
issubclass
(
ob
,
Warning
):
raise
ValueError
,
(
'warning category "%s" must be a Warning subclass'
%
val
)
except
TypeError
:
raise
ValueError
,
(
'warning category "%s" must be a Warning subclass'
%
val
)
return
ob
def
warn_action
(
val
):
OK
=
(
"error"
,
"ignore"
,
"always"
,
"default"
,
"module"
,
"once"
)
if
val
not
in
OK
:
raise
ValueError
,
"warning action %s not one of %s"
%
(
val
,
OK
)
return
val
def
warning_filter_handler
(
section
):
import
warnings
# add the warning filter
warnings
.
filterwarnings
(
section
.
action
,
section
.
message
,
section
.
category
,
section
.
module
,
section
.
lineno
,
1
)
return
section
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