# HG changeset patch # User Sylvain Thénault # Date 1266481564 -3600 # Node ID 994c70fe5006c64caf88e4a0f0de4bfc9db5642f # Parent f4254586e8670016664b09ebdc0c5222726f72d4# Parent 790181bfd19c2433d4d3d98620732f6a240c5eac pfff, sorry to keep messing with default/stable... diff -r f4254586e867 -r 994c70fe5006 debian/control --- a/debian/control Wed Feb 17 20:22:12 2010 +0100 +++ b/debian/control Thu Feb 18 09:26:04 2010 +0100 @@ -77,7 +77,7 @@ Package: cubicweb-common Architecture: all XB-Python-Version: ${python:Versions} -Depends: ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.6.0), python-logilab-common (>= 0.47.0), python-yams (>= 0.27.0), python-rql (>= 0.24.0), python-lxml +Depends: ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.6.0), python-logilab-common (>= 0.48.1), python-yams (>= 0.27.0), python-rql (>= 0.24.0), python-lxml Recommends: python-simpletal (>= 4.0), python-crypto Conflicts: cubicweb-core Replaces: cubicweb-core diff -r f4254586e867 -r 994c70fe5006 server/sqlutils.py --- a/server/sqlutils.py Wed Feb 17 20:22:12 2010 +0100 +++ b/server/sqlutils.py Thu Feb 18 09:26:04 2010 +0100 @@ -178,6 +178,7 @@ def backup_to_file(self, backupfile): for cmd in self.dbhelper.backup_commands(self.dbname, self.dbhost, self.dbuser, backupfile, + dbport=self.dbport, keepownership=False): if _run_command(cmd): if not confirm(' [Failed] Continue anyway?', default='n'): @@ -187,6 +188,7 @@ for cmd in self.dbhelper.restore_commands(self.dbname, self.dbhost, self.dbuser, backupfile, self.encoding, + dbport=self.dbport, keepownership=False, drop=drop): if _run_command(cmd): diff -r f4254586e867 -r 994c70fe5006 web/captcha.py --- a/web/captcha.py Wed Feb 17 20:22:12 2010 +0100 +++ b/web/captcha.py Thu Feb 18 09:26:04 2010 +0100 @@ -17,8 +17,7 @@ from time import time from cubicweb import tags -from cubicweb.view import StartupView -from cubicweb.web import httpcache, formwidgets as fw, formfields as ff +from cubicweb.web import formwidgets as fw def pil_captcha(text, fontfile, fontsize): @@ -61,21 +60,6 @@ return text, out -class CaptchaView(StartupView): - __regid__ = 'captcha' - - http_cache_manager = httpcache.NoHTTPCacheManager - binary = True - templatable = False - content_type = 'image/jpg' - - def call(self): - text, data = captcha.captcha(self._cw.vreg.config['captcha-font-file'], - self._cw.vreg.config['captcha-font-size']) - self._cw.set_session_data('captcha', text) - self.w(data.read()) - - class CaptchaWidget(fw.TextInput): def render(self, form, field, renderer=None): # t=int(time()*100) to make sure img is not cached diff -r f4254586e867 -r 994c70fe5006 web/views/editviews.py --- a/web/views/editviews.py Wed Feb 17 20:22:12 2010 +0100 +++ b/web/views/editviews.py Thu Feb 18 09:26:04 2010 +0100 @@ -12,9 +12,10 @@ from logilab.mtconverter import xml_escape from cubicweb import typed_eid -from cubicweb.view import EntityView +from cubicweb.view import EntityView, StartupView from cubicweb.selectors import (one_line_rset, non_final_entity, match_search_state) +from cubicweb.web import httpcache, captcha from cubicweb.web.views import baseviews, linksearch_select_url @@ -93,3 +94,18 @@ self.w(entity.view('reledit', rtype=rtype)) else: super(EditableFinalView, self).cell_call(row, col, props) + + +class CaptchaView(StartupView): + __regid__ = 'captcha' + + http_cache_manager = httpcache.NoHTTPCacheManager + binary = True + templatable = False + content_type = 'image/jpg' + + def call(self): + text, data = captcha.captcha(self._cw.vreg.config['captcha-font-file'], + self._cw.vreg.config['captcha-font-size']) + self._cw.set_session_data('captcha', text) + self.w(data.read())