remove unused import
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 25 Apr 2013 14:10:55 +0200
changeset 8930 6a02be304486
parent 8929 b747f2532e03
child 8931 4b195bd82e8b
remove unused import pyflakes say they are unused. Tests suite confirms.
appobject.py
cwctl.py
cwvreg.py
dataimport.py
devtools/__init__.py
devtools/devctl.py
devtools/fake.py
devtools/qunit.py
devtools/test/unittest_dbfill.py
devtools/test/unittest_fill.py
devtools/test/unittest_httptest.py
devtools/test/unittest_qunit.py
devtools/testlib.py
doc/book/en/conf.py
doc/tools/generate_modules.py
doc/tutorials/dataimport/schema.py
entities/__init__.py
entities/adapters.py
entities/lib.py
entities/sources.py
entities/test/unittest_base.py
entities/wfobjs.py
entity.py
etwist/http.py
etwist/request.py
etwist/server.py
--- a/appobject.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/appobject.py	Thu Apr 25 14:10:55 2013 +0200
@@ -34,7 +34,6 @@
 from logging import getLogger
 
 from logilab.common.deprecation import deprecated, class_renamed
-from logilab.common.decorators import classproperty
 from logilab.common.logging_ext import set_log_methods
 
 # first line imports for bw compat
--- a/cwctl.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/cwctl.py	Thu Apr 25 14:10:55 2013 +0200
@@ -836,7 +836,6 @@
     name = 'versions'
 
     def versions_instance(self, appid):
-        from logilab.common.changelog import Version
         config = cwcfg.config_for(appid)
         # should not raise error if db versions don't match fs versions
         config.repairing = True
--- a/cwvreg.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/cwvreg.py	Thu Apr 25 14:10:55 2013 +0200
@@ -197,14 +197,14 @@
 from os.path import join, dirname, realpath
 from warnings import warn
 from datetime import datetime, date, time, timedelta
-from functools import partial, reduce
+from functools import reduce
 
 from logilab.common.decorators import cached, clear_cache
 from logilab.common.deprecation import deprecated, class_deprecated
 from logilab.common.modutils import cleanup_sys_modules
 from logilab.common.registry import (
     RegistryStore, Registry, obj_registries,
-    ObjectNotFound, NoSelectableObject, RegistryNotFound)
+    ObjectNotFound, RegistryNotFound)
 
 from rql import RQLHelper
 from yams.constraints import BASE_CONVERTERS
--- a/dataimport.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/dataimport.py	Thu Apr 25 14:10:55 2013 +0200
@@ -75,7 +75,6 @@
 import os.path as osp
 import inspect
 from collections import defaultdict
-from contextlib import contextmanager
 from copy import copy
 from datetime import date, datetime
 from time import asctime
--- a/devtools/__init__.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/__init__.py	Thu Apr 25 14:10:55 2013 +0200
@@ -28,15 +28,14 @@
 import warnings
 from hashlib import sha1 # pylint: disable=E0611
 from datetime import timedelta
-from os.path import (abspath, join, exists, basename, dirname, normpath, split,
-                     isfile, isabs, splitext, isdir, expanduser)
+from os.path import (abspath, join, exists, split, isabs, isdir)
 from functools import partial
 
 from logilab.common.date import strptime
 from logilab.common.decorators import cached, clear_cache
 
-from cubicweb import ConfigurationError, ExecutionError, BadConnectionId
-from cubicweb import CW_SOFTWARE_ROOT, schema, cwconfig
+from cubicweb import ExecutionError, BadConnectionId
+from cubicweb import schema, cwconfig
 from cubicweb.server.serverconfig import ServerConfiguration
 from cubicweb.etwist.twconfig import TwistedConfiguration
 
--- a/devtools/devctl.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/devctl.py	Thu Apr 25 14:10:55 2013 +0200
@@ -122,7 +122,6 @@
 
 
 def _generate_schema_pot(w, vreg, schema, libconfig=None):
-    from copy import deepcopy
     from cubicweb.i18n import add_msg
     from cubicweb.schema import NO_I18NCONTEXT, CONSTRAINTS
     w('# schema pot file, generated on %s\n'
--- a/devtools/fake.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/fake.py	Thu Apr 25 14:10:55 2013 +0200
@@ -25,7 +25,6 @@
 from cubicweb.req import RequestSessionBase
 from cubicweb.cwvreg import CWRegistryStore
 from cubicweb.web.request import CubicWebRequestBase
-from cubicweb.web.http_headers import Headers
 
 from cubicweb.devtools import BASE_URL, BaseApptestConfiguration
 
--- a/devtools/qunit.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/qunit.py	Thu Apr 25 14:10:55 2013 +0200
@@ -29,7 +29,6 @@
 from logilab.common.shellutils import getlogin
 
 import cubicweb
-from cubicweb.view import StartupView
 from cubicweb.web.controller import Controller
 from cubicweb.devtools.httptest import CubicWebServerTC
 
--- a/devtools/test/unittest_dbfill.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/test/unittest_dbfill.py	Thu Apr 25 14:10:55 2013 +0200
@@ -24,7 +24,6 @@
 
 from logilab.common.testlib import TestCase, unittest_main
 
-from cubicweb.schema import Schema, EntitySchema
 from cubicweb.devtools.fill import ValueGenerator, make_tel
 from cubicweb.devtools import ApptestConfiguration
 
--- a/devtools/test/unittest_fill.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/test/unittest_fill.py	Thu Apr 25 14:10:55 2013 +0200
@@ -18,12 +18,10 @@
 """unit tests for cubicweb.devtools.fill module
 
 """
+import re
 
 from logilab.common.testlib import TestCase, unittest_main
 
-from cubicweb.schema import Schema, EntitySchema
-
-import re
 from cubicweb.devtools.fill import ValueGenerator, _ValueGenerator
 
 ISODATE_SRE = re.compile('(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})$')
--- a/devtools/test/unittest_httptest.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/test/unittest_httptest.py	Thu Apr 25 14:10:55 2013 +0200
@@ -20,7 +20,7 @@
 import httplib
 
 from logilab.common.testlib import Tags
-from cubicweb.devtools.httptest import CubicWebServerTC, CubicWebServerConfig
+from cubicweb.devtools.httptest import CubicWebServerTC
 
 
 class TwistedCWAnonTC(CubicWebServerTC):
--- a/devtools/test/unittest_qunit.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/test/unittest_qunit.py	Thu Apr 25 14:10:55 2013 +0200
@@ -1,5 +1,5 @@
 from logilab.common.testlib import unittest_main
-from cubicweb.devtools.qunit import make_qunit_html, QUnitTestCase
+from cubicweb.devtools.qunit import QUnitTestCase
 
 from os import path as osp
 
--- a/devtools/testlib.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/devtools/testlib.py	Thu Apr 25 14:10:55 2013 +0200
@@ -18,7 +18,6 @@
 """this module contains base classes and utilities for cubicweb tests"""
 __docformat__ = "restructuredtext en"
 
-import os
 import sys
 import re
 import urlparse
@@ -40,15 +39,14 @@
 from logilab.common.deprecation import deprecated, class_deprecated
 from logilab.common.shellutils import getlogin
 
-from cubicweb import ValidationError, NoSelectableObject, AuthenticationError
+from cubicweb import ValidationError, NoSelectableObject
 from cubicweb import cwconfig, dbapi, devtools, web, server
 from cubicweb.utils import json
 from cubicweb.sobjects import notification
 from cubicweb.web import Redirect, application
-from cubicweb.server.session import Session
 from cubicweb.server.hook import SendMailOp
 from cubicweb.devtools import SYSTEM_ENTITIES, SYSTEM_RELATIONS, VIEW_VALIDATORS
-from cubicweb.devtools import BASE_URL, fake, htmlparser, DEFAULT_EMPTY_DB_ID
+from cubicweb.devtools import fake, htmlparser, DEFAULT_EMPTY_DB_ID
 from cubicweb.utils import json
 
 # low-level utilities ##########################################################
--- a/doc/book/en/conf.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/doc/book/en/conf.py	Thu Apr 25 14:10:55 2013 +0200
@@ -31,7 +31,6 @@
 # All configuration values have a default value; values that are commented out
 # serve to show the default value.
 
-import sys, os
 from os import path as osp
 
 path = __file__
--- a/doc/tools/generate_modules.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/doc/tools/generate_modules.py	Thu Apr 25 14:10:55 2013 +0200
@@ -19,8 +19,6 @@
 
 """
 
-import sys
-
 EXCLUDE_DIRS = ('test', 'tests', 'examples', 'data', 'doc', 'dist',
                 '.hg', 'migration')
 if __name__ == '__main__':
--- a/doc/tutorials/dataimport/schema.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/doc/tutorials/dataimport/schema.py	Thu Apr 25 14:10:55 2013 +0200
@@ -18,7 +18,6 @@
 """cubicweb-diseasome schema"""
 
 from yams.buildobjs import EntityType, SubjectRelation, String, Int
-from cubicweb.schemas.base import ExternalUri
 
 
 class Disease(EntityType):
--- a/entities/__init__.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/entities/__init__.py	Thu Apr 25 14:10:55 2013 +0200
@@ -19,10 +19,8 @@
 
 __docformat__ = "restructuredtext en"
 
-from warnings import warn
 
-from logilab.common.deprecation import deprecated
-from logilab.common.decorators import cached, classproperty
+from logilab.common.decorators import classproperty
 
 from cubicweb import Unauthorized
 from cubicweb.entity import Entity
--- a/entities/adapters.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/entities/adapters.py	Thu Apr 25 14:10:55 2013 +0200
@@ -26,12 +26,11 @@
 
 from logilab.mtconverter import TransformError
 from logilab.common.decorators import cached
-from logilab.common.deprecation import class_deprecated
 
 from cubicweb import ValidationError, view
 from cubicweb.predicates import (implements, is_instance, relation_possible,
                                 match_exception)
-from cubicweb.interfaces import IDownloadable, ITree, IProgress, IMileStone
+from cubicweb.interfaces import IDownloadable, ITree
 
 
 class IEmailableAdapter(view.EntityAdapter):
--- a/entities/lib.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/entities/lib.py	Thu Apr 25 14:10:55 2013 +0200
@@ -23,8 +23,6 @@
 from urlparse import urlsplit, urlunsplit
 from datetime import datetime
 
-from logilab.common.deprecation import deprecated
-
 from cubicweb import UnknownProperty
 from cubicweb.entity import _marker
 from cubicweb.entities import AnyEntity, fetch_config
--- a/entities/sources.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/entities/sources.py	Thu Apr 25 14:10:55 2013 +0200
@@ -27,7 +27,6 @@
 from logilab.common.configuration import OptionError
 from logilab.mtconverter import xml_escape
 
-from cubicweb import ValidationError
 from cubicweb.entities import AnyEntity, fetch_config
 
 class _CWSourceCfgMixIn(object):
--- a/entities/test/unittest_base.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/entities/test/unittest_base.py	Thu Apr 25 14:10:55 2013 +0200
@@ -25,7 +25,6 @@
 
 from cubicweb.devtools.testlib import CubicWebTC
 
-from cubicweb import ValidationError
 from cubicweb.interfaces import IMileStone, ICalendarable
 from cubicweb.entities import AnyEntity
 
--- a/entities/wfobjs.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/entities/wfobjs.py	Thu Apr 25 14:10:55 2013 +0200
@@ -24,7 +24,6 @@
 
 __docformat__ = "restructuredtext en"
 
-from warnings import warn
 
 from logilab.common.decorators import cached, clear_cache
 from logilab.common.deprecation import deprecated
--- a/entity.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/entity.py	Thu Apr 25 14:10:55 2013 +0200
@@ -26,7 +26,7 @@
 from logilab.common.decorators import cached
 from logilab.common.deprecation import deprecated
 from logilab.common.registry import yes
-from logilab.mtconverter import TransformData, TransformError, xml_escape
+from logilab.mtconverter import TransformData, xml_escape
 
 from rql.utils import rqlvar_maker
 from rql.stmts import Select
--- a/etwist/http.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/etwist/http.py	Thu Apr 25 14:10:55 2013 +0200
@@ -8,8 +8,6 @@
 
 __docformat__ = "restructuredtext en"
 
-from cubicweb.web.http_headers import Headers
-
 class HTTPResponse(object):
     """An object representing an HTTP Response to be sent to the client.
     """
--- a/etwist/request.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/etwist/request.py	Thu Apr 25 14:10:55 2013 +0200
@@ -19,14 +19,8 @@
 
 __docformat__ = "restructuredtext en"
 
-from datetime import datetime
 
-from twisted.web import http
-
-from cubicweb.web import DirectResponse
 from cubicweb.web.request import CubicWebRequestBase
-from cubicweb.web.httpcache import GMTOFFSET
-from cubicweb.web.http_headers import Headers
 
 
 class CubicWebTwistedRequestAdapter(CubicWebRequestBase):
--- a/etwist/server.py	Thu Apr 25 17:30:09 2013 +0200
+++ b/etwist/server.py	Thu Apr 25 14:10:55 2013 +0200
@@ -19,35 +19,25 @@
 __docformat__ = "restructuredtext en"
 
 import sys
-import os
-import os.path as osp
 import select
 import traceback
 import threading
-import re
-from hashlib import md5 # pylint: disable=E0611
-from os.path import join
-from time import mktime
-from datetime import date, timedelta
 from urlparse import urlsplit, urlunsplit
 from cgi import FieldStorage, parse_header
 
 from twisted.internet import reactor, task, threads
-from twisted.internet.defer import maybeDeferred
 from twisted.web import http, server
-from twisted.web import static, resource
+from twisted.web import resource
 from twisted.web.server import NOT_DONE_YET
 
 
 from logilab.mtconverter import xml_escape
 from logilab.common.decorators import monkeypatch
 
-from cubicweb import (AuthenticationError, ConfigurationError,
-                      CW_EVENT_MANAGER, CubicWebException)
+from cubicweb import ConfigurationError, CW_EVENT_MANAGER
 from cubicweb.utils import json_dumps
 from cubicweb.web import DirectResponse
 from cubicweb.web.application import CubicWebPublisher
-from cubicweb.web.http_headers import generateDateTime
 from cubicweb.etwist.request import CubicWebTwistedRequestAdapter
 from cubicweb.etwist.http import HTTPResponse