This repository has been archived by the owner on Nov 3, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from enthought/enh/ribbon-contribution
Extension based ribbon contribution
- Loading branch information
Showing
11 changed files
with
332 additions
and
31 deletions.
There are no files selected for viewing
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
doc/data_analytics_example/data_analytics/pyxll_extension.py
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,16 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
def load(submit_ribbon_tab=None, **kw): | ||
""" Loads the PyXLL modules to be exposed to Excel. """ | ||
|
||
# Try to submit our ribbon piece to PyXLL | ||
|
||
if submit_ribbon_tab: | ||
import os | ||
import pkgutil | ||
tab_template = pkgutil.get_data('data_analytics', 'ribbon_tab.xml') | ||
root_path = os.path.join(os.path.dirname(__file__), '') | ||
tab = tab_template.format(ROOT=root_path) | ||
submit_ribbon_tab('data_analytics', tab) |
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,9 @@ | ||
<tab id="data_analytics_tab" label="DataAnalytics"> | ||
<group id="data_analytics_group" label="Analyze"> | ||
<button id="data_analytics_button" | ||
size="large" | ||
label="Do Some Analytics!" | ||
onAction="pyxll.about" | ||
image="{ROOT}data_analytics_button.png"/> | ||
</group> | ||
</tab> |
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,16 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name='data_analytics', | ||
version='1.0', | ||
packages=find_packages(), | ||
package_data={'data_analytics': ['ribbon_tab.xml', '*.png']}, | ||
entry_points={ | ||
'pyxll.extensions': [ | ||
'data_analytics = data_analytics.pyxll_extension:load' | ||
] | ||
} | ||
) |
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
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ packages = [ | |
'pandas', | ||
'pytz', | ||
'stevedore', | ||
'lxml', | ||
] |
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,16 @@ | ||
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" | ||
loadImage="pyxll.load_image"> <!-- pyxll.load_image is a built-in image loader --> | ||
<ribbon> | ||
<tabs> | ||
<tab id="pyxll_example_tab" label="Sample"> | ||
<group id="Tools" label="Tools"> | ||
<button id="About" | ||
size="large" | ||
label="About PyXLL" | ||
onAction="pyxll.about" | ||
image="about.png"/> | ||
</group> | ||
</tab> | ||
</tabs> | ||
</ribbon> | ||
</customUI> |
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
Oops, something went wrong.