Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
force-bdss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adham Hashibon
force-bdss
Commits
b8574f23
Commit
b8574f23
authored
7 years ago
by
Stefano Borini
Browse files
Options
Downloads
Patches
Plain Diff
Added extension point for UI hooks
parent
5a894eff
No related branches found
No related tags found
1 merge request
!93
UI Hooks
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
force_bdss/factory_registry_plugin.py
+29
-2
29 additions, 2 deletions
force_bdss/factory_registry_plugin.py
force_bdss/ids.py
+1
-0
1 addition, 0 deletions
force_bdss/ids.py
with
30 additions
and
2 deletions
force_bdss/factory_registry_plugin.py
+
29
−
2
View file @
b8574f23
...
...
@@ -9,6 +9,7 @@ from .data_sources.i_data_source_factory import (
IDataSourceFactory
)
from
.kpi.i_kpi_calculator_factory
import
IKPICalculatorFactory
from
.mco.i_mco_factory
import
IMCOFactory
from
.ui_hooks.i_ui_hooks_factory
import
IUIHooksFactory
FACTORY_REGISTRY_PLUGIN_ID
=
"
force.bdss.plugins.factory_registry
"
...
...
@@ -50,6 +51,11 @@ class FactoryRegistryPlugin(Plugin):
id
=
ExtensionPointID
.
NOTIFICATION_LISTENER_FACTORIES
)
ui_hooks_factories
=
ExtensionPoint
(
List
(
IUIHooksFactory
),
id
=
ExtensionPointID
.
UI_HOOK_FACTORIES
)
def
data_source_factory_by_id
(
self
,
id
):
"""
Finds a given data source factory by means of its id.
The ID is as obtained by the function factory_id() in the
...
...
@@ -140,13 +146,13 @@ class FactoryRegistryPlugin(Plugin):
def
notification_listener_factory_by_id
(
self
,
id
):
"""
Finds a given notification listener by means of its id.
The ID is as obtained by the function
bundle
_id() in the
The ID is as obtained by the function
factory
_id() in the
plugin api.
Parameters
----------
id: str
The identifier returned by the
bundle
_id() function.
The identifier returned by the
factory
_id() function.
Raises
------
...
...
@@ -157,3 +163,24 @@ class FactoryRegistryPlugin(Plugin):
return
nl
raise
KeyError
(
id
)
def
ui_hook_factory_by_id
(
self
,
id
):
"""
Finds a given UI Hook factory by means of its id.
The ID is as obtained by the function factory_id() in the
plugin api.
Parameters
----------
id: str
The identifier returned by the factory_id() function.
Raises
------
KeyError: if the entry is not found.
"""
for
hook
in
self
.
ui_hooks_factories
:
if
hook
.
id
==
id
:
return
hook
raise
KeyError
(
id
)
This diff is collapsed.
Click to expand it.
force_bdss/ids.py
+
1
−
0
View file @
b8574f23
...
...
@@ -14,6 +14,7 @@ class ExtensionPointID:
KPI_CALCULATOR_FACTORIES
=
'
force.bdss.kpi_calculator.factories
'
NOTIFICATION_LISTENER_FACTORIES
=
\
'
force.bdss.notification_listener.factories
'
UI_HOOK_FACTORIES
=
'
force.bdss.ui_hook.factories
'
def
factory_id
(
producer
,
identifier
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment