Permalink
Browse files

fix review comments; merge from master

  • Loading branch information...
1 parent adc5bd2 commit 2d93eef272d88c018b5bf6f489f46e23b4a79bca @wbamberg wbamberg committed Jan 18, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 python-lib/cuddlefish/docs/documentationitem.py
@@ -65,11 +65,12 @@ def replacer(match):
def get_metadata(self):
if self.level() == "third-party":
return simplejson.loads("{}")
- path_to_js = os.path.join(self.env_root, "lib", self.source_path_relative_from_module_root(), self.source_filename[:-len(".md")] + ".js")
try:
- js = unicode(open(path_to_js,"r").read(), 'utf8')
+ js = unicode(open(self.js_module_path(),"r").read(), 'utf8')
except IOError:
- return simplejson.loads("{}")
+ raise Exception, "JS module: '" + path_to_js + \
+ "', corresponding to documentation file: '"\
+ + self.source_path_and_filename() + "' wasn't found"
js = self.remove_comments(js)
js_lines = js.splitlines(True)
metadata = ''
@@ -96,6 +97,11 @@ def destination_path(self):
relative_pieces = self.source_path_relative_from_module_root().split(os.sep)
return os.sep.join(root_pieces + relative_pieces)
+ def js_module_path(self):
+ return os.path.join(self.env_root, "lib", \
+ self.source_path_relative_from_module_root(), \
+ self.source_filename[:-len(".md")] + ".js")
+
def relative_url(self):
if self.level() == "third-party":
relative_pieces = ["packages"]

0 comments on commit 2d93eef

Please sign in to comment.