Skip to content

Commit 14a7ef6

Browse files
committed
minor
1 parent 957e140 commit 14a7ef6

File tree

8 files changed

+51
-16
lines changed

8 files changed

+51
-16
lines changed

docs/source/colormaps.gif

992 KB
Loading

docs/source/examples.rst

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
Code Example
2-
============
1+
Code Examples
2+
=============
33

4-
This section is for python programmers you want to use the table widget in their own programs.
4+
This section is for Python programmers.
55

66
Basics
77
------
8-
Code::
8+
9+
If you want to use the table widget in another GUI program::
910

1011
python
1112
from PySide2 import QtCore
@@ -37,3 +38,29 @@ Code::
3738
aw = TestApp()
3839
aw.show()
3940
app.exec_()
41+
42+
Writing a plugin
43+
----------------
44+
45+
This is quite straightforward if you are familiar with PyQt5/Pyside2. Built in plugins are kept in the plugin folder where the program is installed. You can look at these to get an idea how the plugins are written. When you make your own plugin, just add the .py file to the plugin folder under <home dir>/.config/tablexplore. It will be loaded when the program starts and added to the menu. You can add any code into the script, usually designed to execute using the table or plotter. GUI based plugins will be added as docked widgets to the application.
46+
47+
Here is an example plugin::
48+
49+
class ExamplePlugin(Plugin):
50+
"""Template plugin for TableExplore"""
51+
52+
#uncomment capabilities list to appear in menu
53+
capabilities = ['gui']
54+
requires = ['']
55+
menuentry = 'Example Plugin'
56+
name = 'Example Plugin'
57+
58+
def __init__(self, parent=None, table=None):
59+
"""Customise this and/or doFrame for your widgets"""
60+
61+
if parent==None:
62+
return
63+
self.parent = parent
64+
self.table = table
65+
self.createWidgets()
66+
return

docs/source/tablexplore.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ tablexplore.core module
2020
:undoc-members:
2121
:show-inheritance:
2222

23-
tablexplore.data module
24-
-----------------------
25-
26-
.. automodule:: tablexplore.data
27-
:members:
28-
:undoc-members:
29-
:show-inheritance:
30-
3123
tablexplore.dialogs module
3224
--------------------------
3325

docs/source/usage.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,18 @@ Rather than grouping the table directly and then plotting, it is also possible t
189189
Setting preferences
190190
-------------------
191191

192-
Application settings are set from the Edit->Preferences menu. The image below shows the settings which are mostly self explanatory. If settings get corrupted or you want to restor defaults use the 'reset' button.
192+
Application settings are set from the Edit->Preferences menu. The image below shows the settings which are mostly self explanatory. If settings get corrupted or you want to restore defaults use the 'reset' button.
193193

194194
.. image:: preferences.png
195+
196+
Plugins
197+
-------
198+
199+
Plugins can be added by anyone (see code examples on how to do this). Currently there are are only a few useful built-in plugins. New ones will be added below. To add a third party plugin (just a .py file), place it in the plugin folder under <home dir>/.config/tablexplore. For security, you shouldn't just download and run any .py file without trusting it first.
200+
201+
Colormap plugin
202+
+++++++++++++++
203+
204+
This allows you to add your own colormaps for plotting. The screen grab below shows you. You can generate random colors, then edit them. When done choose the type of colormap and then save. Pick a name and this is stored and added to the list of of colormaps in the plot options. You have to restart the program to see it. (Colormaps are kept under .config/tablexplore/cmaps.pkl which can be deleted if you want to clear them.)
205+
206+
.. image:: colormaps.gif

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name = 'tablexplore',
10-
version = '0.6.0',
10+
version = '0.5.1',
1111
description = 'Table analysis and plotting application written in PySide2/PyQt5',
1212
long_description = long_description,
1313
url='https://github.com/dmnfarrell/tablexplore',

tablexplore/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ def addSheet(self, name=None, df=None, meta=None):
944944
pf.hide()
945945

946946
self.updatePlotWidgets(dfw)
947+
self.updatePlugins()
947948
self.tabs.setCurrentIndex(idx)
948949
return
949950

@@ -1284,7 +1285,8 @@ def discoverPlugins(self):
12841285

12851286
from . import plugin
12861287
default = os.path.join(module_path, 'plugins')
1287-
paths = [default]
1288+
other = os.path.join(core.settingspath, 'plugins')
1289+
paths = [default,other]
12881290
failed = plugin.init_plugin_system(paths)
12891291
self.updatePluginMenu()
12901292
return

tablexplore/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
iconpath = os.path.join(module_path, 'icons')
3434
pluginiconpath = os.path.join(module_path, 'plugins', 'icons')
3535
settingspath = os.path.join(homepath, '.config','tablexplore')
36+
if not os.path.exists(settingspath):
37+
os.makedirs(settingspath)
3638
cmapsfile = os.path.join(settingspath, 'cmaps.pkl')
3739

3840
textalignment = None

tablexplore/plugins/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ExamplePlugin(Plugin):
3232
"""Template plugin for TableExplore"""
3333

3434
#uncomment capabilities list to appear in menu
35-
capabilities = ['gui','docked']
35+
capabilities = ['gui']
3636
requires = ['']
3737
menuentry = 'Example Plugin'
3838
name = 'Example Plugin'

0 commit comments

Comments
 (0)