# Path: skeinforge_application/skeinforge_utilities/skeinforge_help.py
# def getNewRepository():
# 	def __init__(self):
# 	def save(self):
# class HelpRepository:


import __init__
import os
from fabmetheus_utilities import settings
from skeinforge_application.skeinforge_utilities import skeinforge_help

from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.



__author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'


def addToMenu( master, menu, repository, window ):
	"Add a tool plugin menu."
	path = settings.getPathInFabmetheusFromFileNameHelp( repository.fileNameHelp )
	capitalizedBasename = os.path.basename(path).capitalize()
	helpRepository = settings.getReadRepository( skeinforge_help.HelpRepository() )
	if repository.openWikiManualHelpPage != None and helpRepository.wikiManualPrimary.value:
		menu.add_command( label = 'Local ' + capitalizedBasename, command = repository.openLocalHelpPage )
	else:
		settings.addAcceleratorCommand('<F1>', repository.openLocalHelpPage, master, menu, 'Local ' + capitalizedBasename )
	if repository.openWikiManualHelpPage != None:
		if helpRepository.wikiManualPrimary.value:
			settings.addAcceleratorCommand('<F1>', repository.openWikiManualHelpPage, master, menu, 'Wiki Manual ' + capitalizedBasename )
		else:
			menu.add_command( label = 'Wiki Manual ' + capitalizedBasename, command = repository.openWikiManualHelpPage )
	menu.add_separator()
	settings.addMenuEntitiesToMenu( menu, helpRepository.menuEntities )

def getNewRepository():
	'Get new repository.'

# Path: skeinforge_application/skeinforge_utilities/skeinforge_help.py
# def getNewRepository():
# 	def __init__(self):
# 	def save(self):
# class HelpRepository:


# Path: skeinforge_application/skeinforge_plugins/help.py
import __init__
import os
from fabmetheus_utilities import settings
from skeinforge_application.skeinforge_utilities import skeinforge_help


from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.



__author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'


def addToMenu( master, menu, repository, window ):
	"Add a tool plugin menu."
	path = settings.getPathInFabmetheusFromFileNameHelp( repository.fileNameHelp )
	capitalizedBasename = os.path.basename(path).capitalize()
	helpRepository = settings.getReadRepository( skeinforge_help.HelpRepository() )
	if repository.openWikiManualHelpPage != None and helpRepository.wikiManualPrimary.value:
		menu.add_command( label = 'Local ' + capitalizedBasename, command = repository.openLocalHelpPage )
	else:
		settings.addAcceleratorCommand('<F1>', repository.openLocalHelpPage, master, menu, 'Local ' + capitalizedBasename )
	if repository.openWikiManualHelpPage != None:
		if helpRepository.wikiManualPrimary.value:
			settings.addAcceleratorCommand('<F1>', repository.openWikiManualHelpPage, master, menu, 'Wiki Manual ' + capitalizedBasename )
		else:
			menu.add_command( label = 'Wiki Manual ' + capitalizedBasename, command = repository.openWikiManualHelpPage )
	menu.add_separator()
	settings.addMenuEntitiesToMenu( menu, helpRepository.menuEntities )

def getNewRepository():
	'Get new repository.'

	return skeinforge_help.HelpRepository()