Skip to content

Commit

Permalink
first revision
Browse files Browse the repository at this point in the history
  • Loading branch information
ghecko committed Feb 9, 2020
0 parents commit cd634b0
Show file tree
Hide file tree
Showing 6 changed files with 751 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
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.
1 change: 1 addition & 0 deletions owfmodules/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__("pkg_resources").declare_namespace(__name__)
1 change: 1 addition & 0 deletions owfmodules/category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__("pkg_resources").declare_namespace(__name__)
40 changes: 40 additions & 0 deletions owfmodules/category/module_name.py
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)
31 changes: 31 additions & 0 deletions setup.py
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']
)

0 comments on commit cd634b0

Please sign in to comment.