~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/parse-librarian-apache-access-logs.py

Working sketch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python -S
2
2
#
3
 
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 
3
# Copyright 2009 Canonical Ltd.  This software is licensed under the
4
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
5
 
6
6
"""Parse librarian apache logs to find out download counts for each file.
19
19
# pylint: disable-msg=W0403
20
20
import _pythonpath
21
21
 
 
22
from zope.component import getUtility
 
23
 
22
24
from storm.sqlobject import SQLObjectNotFound
23
 
from zope.component import getUtility
24
25
 
 
26
from canonical.config import config
 
27
from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
 
28
from canonical.launchpad.scripts.librarian_apache_log_parser import (
 
29
    DBUSER, get_library_file_id)
25
30
from lp.services.apachelogparser.script import ParseApacheLogs
26
 
from lp.services.config import config
27
 
from lp.services.librarian.interfaces import ILibraryFileAliasSet
28
 
from lp.services.librarianserver.apachelogparser import (
29
 
    DBUSER,
30
 
    get_library_file_id,
31
 
    )
32
31
 
33
32
 
34
33
class ParseLibrarianApacheLogs(ParseApacheLogs):