Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lettuce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
lettuce
Commits
75cb38b5
Commit
75cb38b5
authored
Jul 30, 2011
by
Chris Morgan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit more cleaning up of registry.py.
parent
4570991a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
19 deletions
+6
-19
lettuce/registry.py
+6
-19
No files found.
lettuce/registry.py
View file @
75cb38b5
...
...
@@ -22,33 +22,20 @@ world = threading.local()
world
.
_set
=
False
class
CallbackDict
(
dict
):
def
_function_matches
(
self
,
one
,
other
):
params
=
'co_filename'
,
'co_firstlineno'
matches
=
[]
for
param
in
params
:
one_got
=
getattr
(
one
.
func_code
,
param
)
other_got
=
getattr
(
other
.
func_code
,
param
)
matches
.
append
(
one_got
==
other_got
)
def
_function_matches
(
one
,
other
):
return
(
one
.
func_code
.
co_filename
==
other
.
func_code
.
co_filename
and
one
.
func_code
.
co_firstlineno
==
other
.
func_code
.
co_firstlineno
)
return
all
(
matches
)
class
CallbackDict
(
dict
):
def
append_to
(
self
,
where
,
when
,
function
):
found
=
False
for
other_function
in
self
[
where
][
when
]:
if
self
.
_function_matches
(
other_function
,
function
):
found
=
True
if
not
found
:
if
not
any
(
_function_matches
(
o
,
function
)
for
o
in
self
[
where
][
when
]):
self
[
where
][
when
]
.
append
(
function
)
def
clear
(
self
):
for
name
,
action_dict
in
self
.
items
():
for
callback_list
in
action_dict
.
values
():
while
callback_list
:
callback_list
.
pop
()
callback_list
[:]
=
[]
STEP_REGISTRY
=
{}
...
...
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