# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: nrm1977@gmail.com-20121010174502-maa7bg2c3k095u7w
# target_branch: http://bzr.nvaccess.org/nvda/main/
# testament_sha1: 20cb5da513c65392e2df7408047951336bb4112b
# timestamp: 2012-10-10 19:55:31 +0200
# base_revision_id: mhameed@src.gnome.org-20121010092625-\
#   ecs90q4v3tdl4yjy
# 
# Begin patch
=== modified file 'source/addonHandler.py'
--- source/addonHandler.py	2012-09-14 00:14:35 +0000
+++ source/addonHandler.py	2012-10-10 17:45:02 +0000
@@ -291,6 +291,28 @@
 			if func:
 				func(*args,**kwargs)
 
+
+
+
+	def getDocFolder(self):
+		langs = [languageHandler.getLanguage(), "en"]
+		for lang in langs:
+			docFolder = os.path.join(self.path, "doc", lang)
+			if os.path.isdir(docFolder):
+				return docFolder
+			if "_" in lang:
+				tryLang = lang.split("_")[0]
+				docFolder = os.path.join(self.path, "doc", tryLang)
+				if os.path.isdir(docFolder):
+					return docFolder
+				if tryLang == "en":
+					break
+			elif lang == "en":
+				break
+		return None
+
+
+
 def getCodeAddon(obj=None, frameDist=1):
 	""" Returns the L{Addon} where C{obj} is defined. If obj is None the caller code frame is assumed to allow simple retrieval of "current calling addon".
 	@param obj: python object or None for default behaviour.
@@ -466,3 +488,12 @@
 	@property
 	def errors(self):
 		return self._errors
+
+
+
+def getDocPath(fileName="readme.txt"):
+	addon = getCodeAddon(frameDist=2)
+	path = os.path.join(addon.getDocFolder(), fileName)
+	if os.path.isfile(path):
+		return path
+	return addon.getDocFolder()

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWZQkCIAAEG7flGAyWmf/939H
VIq////wAAIIAGATfDIPN97vQUeClerYo0d2AAFG64k957nduxpjt3ZZ3M5SpVL2rVRZtEoSkBTT
0JGmmnqYmyNpGoAAA0AABJIATJiQRJ6Cg0M1AAAAAA5gCMExAMAmCaMhoYBMEYmEmokTSm09SejS
elN6k00PRAAaB6h6n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