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

[ccplugin] stop using dbapi

so that awstat is ready for cw 3.21
parent 50de23c7511b
......@@ -13,7 +13,7 @@ author_email = 'contact@logilab.fr'
description = 'cubicweb integrated awstats frontend'
web = 'http://www.cubicweb.org/project/%s' % distname
__depends__ = {'cubicweb': '>= 3.19.0',}
__depends__ = {'cubicweb': '>= 3.20.0',}
__recommends__ = {'cubicweb-raphael': None,}
classifiers = [
......
......@@ -14,7 +14,7 @@ from logilab.common.shellutils import ProgressBar
from cubicweb import cwconfig, UnknownEid
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.cwctl import CWCTL
......@@ -223,12 +223,13 @@ class UpdateWebstatsCommand(Command):
except KeyError:
login, pwd = manager_userpasswd()
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:
print 'wrong user/password'
else:
break
session = repo._get_session(cnx.sessionid)
# XXX keep reference on cnx otherwise cnx.__del__ will cause trouble
cnx.use_web_compatible_requests(session.vreg.config['base-url'])
return cnx, session
......
......@@ -20,7 +20,7 @@ BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: %{python} %{python}-setuptools
Requires: cubicweb >= 3.19.0
Requires: cubicweb >= 3.20.0
%description
awstats component for the CubicWeb framework
......
......@@ -10,7 +10,7 @@ Homepage: http://www.cubicweb.org/project/awstats
Package: cubicweb-awstats
Architecture: all
Depends: cubicweb-common (>= 3.19.0)
Depends: cubicweb-common (>= 3.20.0)
Recommends: cubicweb-raphael
Description: cubicweb integrated awstats frontend
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