Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Mirror
cc-node
Commits
54951231
Commit
54951231
authored
12 years ago
by
Anael Beutot
Browse files
Options
Downloads
Patches
Plain Diff
Removed plugins.py
parent
40aaf4d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cloudcontrol/node/host/__init__.py
+1
-1
1 addition, 1 deletion
cloudcontrol/node/host/__init__.py
cloudcontrol/node/plugins.py
+0
-47
0 additions, 47 deletions
cloudcontrol/node/plugins.py
with
1 addition
and
48 deletions
cloudcontrol/node/host/__init__.py
+
1
−
1
View file @
54951231
...
...
@@ -16,8 +16,8 @@ from subprocess import Popen, PIPE, STDOUT
from
sjrpc.utils
import
pass_connection
,
threadless
from
sjrpc.core.protocols
import
TunnelProtocol
from
cloudcontrol.common.client.tags
import
Tag
,
tag_inspector
from
cloudcontrol.common.client.plugins
import
Base
as
BasePlugin
from
cloudcontrol.node.plugins
import
Base
as
BasePlugin
from
cloudcontrol.node.host
import
tags
...
...
This diff is collapsed.
Click to expand it.
cloudcontrol/node/plugins.py
deleted
100644 → 0
+
0
−
47
View file @
40aaf4d6
"""
Plugins helpers for Cloud Control node.
"""
from
cloudcontrol.node.tags
import
TagDB
class
Base
(
object
):
"""
Example skeleton plugin for cc-node.
If you want to create your own plugin for the `cc-node` you may create an
object that would quack just like this one or just inherit from this class.
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
"""
:param loop: MainLoop instance
"""
#: MainLoop instance
self
.
main
=
kwargs
.
pop
(
'
loop
'
)
# plugins may define tags (see :mod:`ccnode.tags`)
self
.
tag_db
=
TagDB
()
# plugins may define handler functions that would be called by the
# server
self
.
rpc_handler
=
dict
()
# tag_db and rpc_handler can be implemented as properties if more logic
# is needed
def
__hash__
(
self
):
"""
This method is used when registering a plugin in the main loop.
By default, only one instance is allowed. Subclasses can overide this
method to change this behaviour.
"""
return
hash
(
self
.
__class__
.
__name__
)
def
start
(
self
):
"""
Used to start pyev watchers.
"""
pass
def
stop
(
self
):
"""
Cleanup for plugins, can be used to clean pyev watchers.
"""
self
.
main
=
None
# TODO dependencies
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