# -*- coding: utf-8 -*-
from arelle import PluginManager
from random import randint
import sys
'''
Hello dolly is a simple "Hello world" to demonstrate how plugins
are written for Arelle
'''

LYRICS =  ["I said hello, dolly,......well, hello, dolly", \
            "It's so nice to have you back where you belong ", \
            "You're lookin' swell, dolly.......i can tell, dolly ", \
            "You're still glowin'...you're still crowin'...you're still goin' strong ", \
            "I feel that room swayin'......while the band's playin' ", \
            "One of your old favourite songs from way back when ", \
            "So..... take her wrap, fellas.......find her an empty lap, fellas ", \
            "Dolly'll never go away again" 
            ]

def randomLyric():
    ''' A random lyrics.'''
    return LYRICS[randint(0, len(LYRICS))]
        
def menuEntender(cntlr, menu):
    menu.add_cascade(label="Hello i18n", underline=0, command=lambda: menuCommand(cntlr) )

def menuCommand(cntlr):
    i10L_world = _("Hello World");
    cntlr.addToLog(i10L_world)
    import tkinter
    tkinter.messagebox.showinfo(_("Prints 'Hello World'"), i10L_world, parent=cntlr.parent)            

'''
   Do not use _( ) in pluginInfo itself (it is applied later, after loading
'''
__pluginInfo__ = {
    'name': 'Hello i18n',
    'version': '0.9',
    'description': '''Minimal plugin that demonstrates i18n internationalization by localized gettext.''',
    'localeURL': "locale",
    'localeDomain': 'hello_i18n',
    'license': 'Apache-2',
    'author': 'R\u00e9gis D\u00e9camps',
    'copyright': '(c) Copyright 2012 Mark V Systems Limited, All rights reserved.',
    # classes of mount points (required)
    'CntlrWinMain.Menu.Tools': menuEntender
}

@@ -1,856 +1,164 @@
-# -*- coding: utf-8 -*-%0Afrom arelle import PluginManager%0Afrom random import randint%0Aimport sys%0A'''%0AHello dolly is a simple %22Hello world%22 to demonstrate how plugins%0Aare written for Arelle%0A'''%0A%0ALYRICS =  %5B%22I said hello, dolly,......well, hello, dolly%22, %5C%0A            %22It's so nice to have you back where you belong %22, %5C%0A            %22You're lookin' swell, dolly.......i can tell, dolly %22, %5C%0A            %22You're still glowin'...you're still crowin'...you're still goin' strong %22, %5C%0A            %22I feel that room swayin'......while the band's playin' %22, %5C%0A            %22One of your old favourite songs from way back when %22, %5C%0A            %22So..... take her wrap, fellas.......find her an empty lap, fellas %22, %5C%0A            %22Dolly'll never go away again%22 %0A            %5D%0A%0Adef randomLyric():%0A    ''' A random lyrics.'''%0A    return LYRICS%5Brandint(0, len(LYRICS))%5D
+'''%0AHello dolly is a simple %22Hello world%22 to demonstrate how plugins%0Aare written for Arelle%0A%0A(c) Copyright 2012 Mark V Systems Limited, All rights reserved.%0A'''
 %0A   

clean up unnecessary code in hello_i18n plug in example