Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wspy
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
wspy
Commits
815fe7bb
Commit
815fe7bb
authored
Aug 18, 2013
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added xtension registration function
parent
f281e9ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
extension.py
extension.py
+20
-0
No files found.
extension.py
View file @
815fe7bb
...
...
@@ -93,3 +93,23 @@ def filter_extensions(extensions):
compat
.
append
(
ext
)
return
compat
"""
Class map used to find contructors for client-specified extensions. Not to be
modified manually, only through `register_extension`.
"""
extension_class_map
=
{}
def
register_extension
(
ext
):
if
not
isinstance
(
ext
,
Extension
):
raise
ValueError
(
'extensions should extend the `Extension` class'
)
if
ext
.
name
in
extension_clas_map
:
raise
KeyError
(
'extension "%s" has already been registered'
%
ext
.
name
)
extension_class_map
[
ext
.
name
]
=
ext
register_extension
(
DeflateFrame
)
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