forked from Quasars/orange-spectroscopy
-
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 47e87ab
Showing
13 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
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,21 @@ | ||
# Build files | ||
build | ||
dist | ||
*.egg-info/* | ||
*.so | ||
*.la | ||
*.o | ||
*.py[doc] | ||
MANIFEST | ||
|
||
# Cython generated files | ||
__pycache__ | ||
|
||
# Editor files | ||
.idea | ||
.idea/* | ||
*~ | ||
.project | ||
.pydevproject | ||
.settings/* | ||
.DS_Store |
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,3 @@ | ||
# Ref https://docs.python.org/2/distutils/sourcedist.html#commands | ||
recursive-include orangecontrib *.ows icons/* | ||
global-exclude __pycache__ |
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,30 @@ | ||
Orange3 Example Add-on | ||
====================== | ||
|
||
This is an example add-on for [Orange3](http://orange.biolab.si). Add-on can extend Orange either | ||
in scripting or GUI part, or in both. We here focus on the GUI part and implement a simple (empty) widget, | ||
register it with Orange and add a new workflow with this widget to example tutorials. | ||
|
||
Installation | ||
------------ | ||
|
||
To install the add-on, run | ||
|
||
python setup.py install | ||
|
||
To register this add-on with Orange, but keep the code in the development directory (do not copy it to | ||
Python's site-packages directory), run | ||
|
||
python setup.py develop | ||
|
||
Usage | ||
----- | ||
|
||
After the installation, the widget from this add-on is registered with Orange. To run Orange from the terminal, | ||
use | ||
|
||
python -m Orange.canvas | ||
|
||
The new widget appears in the toolbox bar under the section Example. | ||
|
||
![screenshot](https://github.com/biolab/orange3-example-addon/blob/master/screenshot.png) |
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,3 @@ | ||
__import__("pkg_resources").declare_namespace(__name__) | ||
# orangecontrib is a namespace modules shared by multiple Orange add-on so it | ||
# needs to declare namespace. |
Empty file.
Empty file.
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,18 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<scheme description="" title="Example Workflow" version="2.0"> | ||
<nodes> | ||
<node id="0" name="Example Widget" position="(129.0, 126.0)" project_name="Orange3-Example-Add-on" qualified_name="orangecontrib.example.widgets.mywidget.MyWidget" title="Example Widget" version="" /> | ||
</nodes> | ||
<links /> | ||
<annotations> | ||
<arrow end="(183.0, 144.0)" fill="#C1272D" id="0" start="(283.0, 238.0)" /> | ||
<text font-family="Helvetica" font-size="16" id="1" rect="(259.0, 260.0, 150.0, 44.0)">This is a wiget from an addon</text> | ||
</annotations> | ||
<thumbnail /> | ||
<node_properties> | ||
<properties format="pickle" node_id="0">gAN9cQBYEwAAAHNhdmVkV2lkZ2V0R2VvbWV0cnlxAWNzaXAKX3VucGlja2xlX3R5cGUKcQJYDAAA | ||
AFB5UXQ0LlF0Q29yZXEDWAoAAABRQnl0ZUFycmF5cQRDLgHZ0MsAAQAAAAAGEQAABHQAAAbYAAAE | ||
7QAABhEAAASKAAAG2AAABO0AAAAAAABxBYVxBodxB1JxCHMu | ||
</properties> | ||
</node_properties> | ||
</scheme> |
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,8 @@ | ||
# Category metadata. | ||
|
||
# Category icon show in the menu | ||
ICON = "icons/category.svg" | ||
|
||
# Background color for category background in menu | ||
# and widget icon background in workflow. | ||
BACKGROUND = "light-blue" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
from PyQt4 import QtCore, QtGui | ||
from Orange.widgets.widget import OWWidget | ||
from Orange.widgets import gui | ||
|
||
|
||
class MyWidget(OWWidget): | ||
# Widget needs a name, or it is considered an abstract widget | ||
# and not shown in the menu. | ||
name = "Hello World" | ||
icon = "icons/mywidget.svg" | ||
want_main_area = False | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
label = QtGui.QLabel("Hello, World!") | ||
self.controlArea.layout().addWidget( | ||
label, QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,43 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup, find_packages | ||
|
||
ENTRY_POINTS = { | ||
# Entry point used to specify packages containing tutorials accessible | ||
# from welcome screen. Tutorials are saved Orange Workflows (.ows files). | ||
'orange.widgets.tutorials': ( | ||
# Syntax: any_text = path.to.package.containing.tutorials | ||
'exampletutorials = orangecontrib.example.tutorials', | ||
), | ||
|
||
# Entry point used to specify packages containing widgets. | ||
'orange.widgets': ( | ||
# Syntax: category name = path.to.package.containing.widgets | ||
# Widget category specification can be seen in | ||
# orangecontrib/example/widgets/__init__.py | ||
'Infrared = orangecontrib.infrared.widgets', | ||
), | ||
} | ||
|
||
KEYWORDS = ( | ||
# [PyPi](https://pypi.python.org) packages with keyword "orange3 add-on" | ||
# can be installed using the Orange Add-on Manager | ||
'orange3 add-on', | ||
) | ||
|
||
if __name__ == '__main__': | ||
setup( | ||
name="Orange-Infrared", | ||
description='', | ||
author='', | ||
author_email='', | ||
packages=find_packages(), | ||
install_requires=[ | ||
'Orange', | ||
], | ||
entry_points=ENTRY_POINTS, | ||
keywords=KEYWORDS, | ||
namespace_packages=['orangecontrib'], | ||
include_package_data=True, | ||
zip_safe=False, | ||
) |