-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cd634b0
Showing
6 changed files
with
751 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# owfmodules.skeleton | ||
Module base repository | ||
|
||
Please read [CONTRIBUTING.md](https://bitbucket.org/octowire/octowire-framework/src/master/CONTRIBUTING.md) to follow the contribution process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__import__("pkg_resources").declare_namespace(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__import__("pkg_resources").declare_namespace(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from octowire_framework.module.AModule import AModule | ||
|
||
|
||
class ClassName(AModule): | ||
def __init__(self, owf_config): | ||
super(ClassName, self).__init__(owf_config) | ||
self.meta.update({ | ||
'name': '', | ||
'version': '', | ||
'description': '', | ||
'author': '' | ||
}) | ||
self.options = [ | ||
{"Name": "opt1", "Value": "", "Required": True, "Type": "bool", | ||
"Description": "opt1 description", "Default": True}, | ||
{"Name": "opt2", "Value": "", "Required": True, "Type": "int", | ||
"Description": "opt2 description", "Default": ""}, | ||
{"Name": "opt3", "Value": "", "Required": True, "Type": "string", | ||
"Description": "opt3 description", "Default": "opt3 default value"} | ||
] | ||
# if necessary | ||
self.advanced_options.append( | ||
{"Name": "adv_opt_name", "Value": "", "Required": True, "Type": "int", | ||
"Description": "Advanced option description", "Default": ""} | ||
) | ||
|
||
def run(self): | ||
""" | ||
Our code here | ||
:return: | ||
""" | ||
# Initialization example | ||
# Detect and connect to the octowire hardware. Set the self.owf_serial variable if found. | ||
self.connect() | ||
if not self.owf_serial: | ||
return | ||
try: | ||
"""Call my function here""" | ||
except (Exception, ValueError) as err: | ||
self.logger.handle(err, self.logger.ERROR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
|
||
|
||
from setuptools import setup, find_packages | ||
|
||
__authors__ = "" | ||
__copyright__ = "" | ||
__license__ = "GPLv3" | ||
__version__ = "1.0.0" | ||
__contact__ = "" | ||
|
||
description = '' | ||
name = 'owfmodules.<category>.<module_name>' | ||
|
||
setup( | ||
name=name, | ||
version=__version__, | ||
packages=find_packages(), | ||
license=__license__, | ||
description=description, | ||
author=__authors__, | ||
zip_safe=True, | ||
url='https://bitbucket.org/octowire/' + name, | ||
classifiers=[ | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
'Programming Language :: Python :: 3', | ||
'Development Status :: 5 - Production/Stable' | ||
], | ||
keywords=['octowire', 'framework', 'hardware', 'security'] | ||
) |