Changeset 731:ecb0716ced56 in hatta-dev


Ignore:
Timestamp:
01/22/10 15:56:31 (2 years ago)
Author:
sheep@…
Branch:
default
Message:

localize forbidden pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hatta.py

    r724 r731  
    411411        file_path = self._file_path(title) 
    412412        if os.path.islink(file_path): 
    413             raise werkzeug.exceptions.Forbidden(u"Can't edit symbolic links") 
     413            raise werkzeug.exceptions.Forbidden(_(u"Can't edit symbolic links")) 
    414414        mercurial.util.rename(file_name, file_path) 
    415415        changectx = self._changectx() 
     
    482482        file_path = self._file_path(title) 
    483483        if os.path.islink(file_path): 
    484             raise werkzeug.exceptions.Forbidden(u"Can't edit symbolic links") 
     484            raise werkzeug.exceptions.Forbidden(_(u"Can't edit symbolic links")) 
    485485        try: 
    486486            os.unlink(file_path) 
     
    495495        file_path = self._file_path(title) 
    496496        if os.path.islink(file_path): 
    497             raise werkzeug.exceptions.Forbidden(u"Can't read symbolic links") 
     497            raise werkzeug.exceptions.Forbidden(_(u"Can't read symbolic links")) 
    498498        try: 
    499499            return open(file_path, "rb") 
     
    19121912            rev = -1 
    19131913        except werkzeug.exceptions.Forbidden: 
    1914             yield werkzeug.html.p(werkzeug.html(_(u"Can't edit a symbolic link."))) 
     1914            yield werkzeug.html.p( 
     1915                werkzeug.html(_(u"Can't edit symbolic links"))) 
    19151916            return 
    19161917        if preview: 
     
    25732574        ] 
    25742575        if self.read_only: 
    2575             raise werkzeug.exceptions.Forbidden(_("This site is read-only.")) 
     2576            raise werkzeug.exceptions.Forbidden(_(u"This site is read-only.")) 
    25762577        if title in restricted_pages: 
    2577             raise werkzeug.exceptions.Forbidden(_("""Can't edit this page. 
     2578            raise werkzeug.exceptions.Forbidden(_(u"""Can't edit this page. 
    25782579It can only be edited by the site admin directly on the disk.""")) 
    25792580        if title in self.index.page_links(self.locked_page): 
    2580             raise werkzeug.exceptions.Forbidden(_("This page is locked.")) 
     2581            raise werkzeug.exceptions.Forbidden(_(u"This page is locked.")) 
    25812582 
    25822583    def save(self, request, title): 
     
    26092610                    for link, label in page.extract_links(text): 
    26102611                        if title == link: 
    2611                             raise werkzeug.exceptions.Forbidden() 
     2612                            raise werkzeug.exceptions.Forbidden( 
     2613                                _(u"This page is locked.")) 
    26122614                if u'href="' in comment or u'http:' in comment: 
    26132615                    raise werkzeug.exceptions.Forbidden() 
     
    31753177 
    31763178        if not self.config.get_bool('hgweb', False): 
    3177             raise werkzeug.exceptions.Forbidden('Repository access disabled.') 
     3179            raise werkzeug.exceptions.Forbidden( 
     3180                _(u'Repository access disabled.')) 
    31783181        app = mercurial.hgweb.request.wsgiapplication( 
    31793182            lambda: mercurial.hgweb.hgweb(self.storage.repo, self.site_name)) 
     
    31913194 
    31923195        if not request.remote_addr.startswith('127.'): 
    3193             raise werkzeug.exceptions.Forbidden() 
     3196            raise werkzeug.exceptions.Forbidden( 
     3197                _(u'This URL can only be called locally.')) 
    31943198        def agony(): 
    31953199            yield u'Oh dear!' 
Note: See TracChangeset for help on using the changeset viewer.