- def _file_path(self, title):
- return os.path.join(self.path, urlquote(title, safe=''))
+ def _file_path(self, title, type='.xml'):
+ """ Return plain version if exists in repo, add extension otherwise. """
+ path = os.path.join(self.path, urlquote(title, safe=''))
+ if type and self._title_to_file(title, '') not in self.repo['tip']:
+ path += type
+ return path