Skip to content

Commit

Permalink
Merge pull request #94 from pllim/fix-ginga-config
Browse files Browse the repository at this point in the history
Update Ginga config machinery
  • Loading branch information
pllim committed Feb 22, 2016
2 parents 1b11204 + 34da0f7 commit dd10906
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Installation

* `Astropy <http://www.astropy.org/>`_ 1.1 or later.
* `SciPy <http://docs.scipy.org/doc/scipy/reference/>`_ 0.16 or later.
* Ginga 2.5.20160128021834 or later, available from
* Ginga 2.5.20160222004742 or later, available from
`Ginga's GitHub page <https://github.com/ejeschke/ginga/>`_.
* The latest version of ``stginga`` available from
`stginga's GitHub page <https://github.com/spacetelescope/stginga>`_.
Expand Down
5 changes: 4 additions & 1 deletion docs/source/run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ The key is to use Ginga's built-in configuration machinery.
Create a ``$HOME/.ginga/ginga_config.py`` file or modify your existing copy
with the following contents::

def post_gui_config(ginga):
def pre_gui_config(ginga):
from stginga import load_plugins
load_plugins(ginga)

def post_gui_config(ginga):
ginga.start_global_plugin('ChangeHistory')

Then, you can run Ginga natively as follows::

ginga [args]
Expand Down
1 change: 1 addition & 0 deletions stginga/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
unicode_literals)

__version__ = '0.1.0.dev0'
__vdate__ = '2016-02-22'

from .plugin_info import *
9 changes: 2 additions & 7 deletions stginga/plugin_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@

def load_plugins(ginga):
"""Load the ``stginga`` plugins.
This also automatically starts necessary core Ginga global plugins.
Parameters
----------
ginga
The ginga app object that is provided to ``post_gui_config`` in
The ginga app object that is provided to ``pre_gui_config`` in
``ginga_config.py``.
"""
Expand All @@ -47,15 +46,11 @@ def load_plugins(ginga):
else:
ginga.add_local_plugin(lplg)

# Auto start core global plugins
for gplg in ('ChangeHistory', ):
ginga.start_global_plugin(gplg)


def _get_stginga_plugins():
# TODO: When we use stable Ginga release, not the dev, we can remove this
# and just have version check in setup.py
if ginga_version < '2.5.20160128021834':
if ginga_version < '2.5.20160222004742':
warnings.warn('Your Ginga version {0} is old, stginga might not work '
'properly'.format(ginga_version), AstropyUserWarning)

Expand Down

0 comments on commit dd10906

Please sign in to comment.