Add Gammapy song karaoke option!
@@ -40,7 +40,6 @@ the following sub-packages (e.g. `gammapy.spectrum`):
# ----------------------------------------------------------------------------
from ._astropy_init import *
# ----------------------------------------------------------------------------
-import webbrowser
# For egg_info test builds to pass, put package imports here.
if not _ASTROPY_SETUP_: # pylint: disable=undefined-variable
@@ -48,8 +47,34 @@ if not _ASTROPY_SETUP_: # pylint: disable=undefined-variable
pass
-def song():
+def song(karaoke=False):
"""
Listen to the Gammapy song.
+
+ Make sure you listen on good headphones or speakers. You'll be not disappointed!
+
+ Parameters
+ ----------
+ karaoke : bool
+ Print lyrics to sing along.
"""
+ import webbrowser
+ import sys
+
webbrowser.open('http://gammapy.org/gammapy_song.mp3')
+
+ if karaoke:
+ lyrics = ("\nGammapy Song Lyrics\n"
+ "-------------------\n\n"
+ "Gammapy, gamma-ray data analysis package\n"
+ "Gammapy, prototype software CTA science tools\n\n"
+ "Supernova remnants, pulsar winds, AGN, Gamma, Gamma, Gammapy\n"
+ "Galactic plane survey, pevatrons, Gammapy, Gamma, Gammapy\n"
+ "Gammapy, github, continuous integration, readthedocs, travis, "
+ "open source project\n\n"
+ "Gammapy, Gammapy\n\n"
+ "Supernova remnants, pulsar winds, AGN, Gamma, Gamma, Gammapy\n"
+ )
+
+ centered = '\n'.join('{:^80}'.format(s) for s in lyrics.split('\n'))
+ sys.stdout.write(centered)
