Changeset 744:3a967f693570 in hatta-dev for hatta.py
Legend:
- Unmodified
- Added
- Removed
-
hatta.py
r743 r744 682 682 """ 683 683 684 # XXX Override required methods here. 684 periods_re = re.compile(r'^[.]|(?<=/)[.]') 685 slashes_re = re.compile(r'^[/]|(?<=/)[/]') 686 687 def _title_to_file(self, title): 688 """Modified escaping to allow slashes and spaces.""" 689 690 title = unicode(title).strip() 691 escaped = werkzeug.url_quote(title, safe='/ ') 692 path = os.path.join(self.repo_prefix, escaped) 693 path = self.periods_re.sub('%2E', path) 694 path = self.slashes_re.sub('%2F', path) 695 return path 696 697 def save_file(self, title, file_name, author=u'', comment=u'', parent=None): 698 """Make the subdirectories if needed.""" 699 700 file_path = self._file_path(title) 701 self._check_path(file_path) 702 dir_path = os.path.dirname(file_path) 703 try: 704 os.makedirs(dir_path) 705 except OSError: 706 pass 707 super(WikiSubdirectoryStorage, self).save_file(title, file_name, 708 author, comment, parent) 685 709 686 710 … … 1933 1957 comment = _(u'created') 1934 1958 rev = -1 1935 except werkzeug.exceptions.Forbidden :1959 except werkzeug.exceptions.Forbidden, e: 1936 1960 yield werkzeug.html.p( 1937 werkzeug.html(_(u "Can't edit symbolic links or directories")))1961 werkzeug.html(_(unicode(e)))) 1938 1962 return 1939 1963 if preview:
Note: See TracChangeset
for help on using the changeset viewer.
