Commit 909e6e4e authored by Samuel Trégouët's avatar Samuel Trégouët
Browse files

[ccplugin] stop using dbapi

so that awstat is ready for cw 3.21
parent 50de23c7511b
...@@ -13,7 +13,7 @@ author_email = 'contact@logilab.fr' ...@@ -13,7 +13,7 @@ author_email = 'contact@logilab.fr'
description = 'cubicweb integrated awstats frontend' description = 'cubicweb integrated awstats frontend'
web = 'http://www.cubicweb.org/project/%s' % distname web = 'http://www.cubicweb.org/project/%s' % distname
__depends__ = {'cubicweb': '>= 3.19.0',} __depends__ = {'cubicweb': '>= 3.20.0',}
__recommends__ = {'cubicweb-raphael': None,} __recommends__ = {'cubicweb-raphael': None,}
classifiers = [ classifiers = [
......
...@@ -14,7 +14,7 @@ from logilab.common.shellutils import ProgressBar ...@@ -14,7 +14,7 @@ from logilab.common.shellutils import ProgressBar
from cubicweb import cwconfig, UnknownEid from cubicweb import cwconfig, UnknownEid
from cubicweb import AuthenticationError from cubicweb import AuthenticationError
from cubicweb.dbapi import in_memory_repo_cnx from cubicweb.server.utils import TasksManager
from cubicweb.toolsutils import Command from cubicweb.toolsutils import Command
from cubicweb.cwctl import CWCTL from cubicweb.cwctl import CWCTL
...@@ -223,12 +223,13 @@ class UpdateWebstatsCommand(Command): ...@@ -223,12 +223,13 @@ class UpdateWebstatsCommand(Command):
except KeyError: except KeyError:
login, pwd = manager_userpasswd() login, pwd = manager_userpasswd()
try: try:
repo, cnx = in_memory_repo_cnx(config, login=login, password=pwd) repo = Repository(config, TasksManager())
session = repo.new_session(login, password=pwd)
cnx = session.new_cnx()
except AuthenticationError: except AuthenticationError:
print 'wrong user/password' print 'wrong user/password'
else: else:
break break
session = repo._get_session(cnx.sessionid)
# XXX keep reference on cnx otherwise cnx.__del__ will cause trouble # XXX keep reference on cnx otherwise cnx.__del__ will cause trouble
cnx.use_web_compatible_requests(session.vreg.config['base-url']) cnx.use_web_compatible_requests(session.vreg.config['base-url'])
return cnx, session return cnx, session
......
...@@ -20,7 +20,7 @@ BuildArch: noarch ...@@ -20,7 +20,7 @@ BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: %{python} %{python}-setuptools BuildRequires: %{python} %{python}-setuptools
Requires: cubicweb >= 3.19.0 Requires: cubicweb >= 3.20.0
%description %description
awstats component for the CubicWeb framework awstats component for the CubicWeb framework
......
...@@ -10,7 +10,7 @@ Homepage: http://www.cubicweb.org/project/awstats ...@@ -10,7 +10,7 @@ Homepage: http://www.cubicweb.org/project/awstats
Package: cubicweb-awstats Package: cubicweb-awstats
Architecture: all Architecture: all
Depends: cubicweb-common (>= 3.19.0) Depends: cubicweb-common (>= 3.20.0)
Recommends: cubicweb-raphael Recommends: cubicweb-raphael
Description: cubicweb integrated awstats frontend Description: cubicweb integrated awstats frontend
CubicWeb is a semantic web application framework. CubicWeb is a semantic web application framework.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment