[PATCH 2 of 4] paster_commands: remove unused imports

Thomas De Schampheleire thomas.de_schampheleire at nokia.com
Thu Aug 30 20:42:06 UTC 2018


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1535653703 -7200
#      Thu Aug 30 20:28:23 2018 +0200
# Node ID 7e34fff5282e2157743491558a37b5f8d32203d7
# Parent  ad3cc6e18d57c36c56334476f2a92da19cdf4739
paster_commands: remove unused imports

Remove some unused imports, using 'autoflake' followed by manual redacting.
    find kallithea/lib/paster_commands/ -name "*.py" \
        | xargs autoflake --remove-all-unused-imports -i

This same command could be applied gradually throughout the code base as
areas are touched. Since autoflake may be too greedy in special cases, it is
more difficult to do a big-bang action over all code.

diff --git a/kallithea/lib/paster_commands/cache_keys.py b/kallithea/lib/paster_commands/cache_keys.py
--- a/kallithea/lib/paster_commands/cache_keys.py
+++ b/kallithea/lib/paster_commands/cache_keys.py
@@ -27,8 +27,6 @@ Original author and date, and relevant c
 """
 
 
-import os
-import sys
 
 from kallithea.lib.paster_commands.common import BasePasterCommand
 from kallithea.model.meta import Session
diff --git a/kallithea/lib/paster_commands/celeryd.py b/kallithea/lib/paster_commands/celeryd.py
--- a/kallithea/lib/paster_commands/celeryd.py
+++ b/kallithea/lib/paster_commands/celeryd.py
@@ -4,7 +4,6 @@ import argparse
 
 import kallithea
 from kallithea.lib.paster_commands.common import BasePasterCommand
-from kallithea.lib.utils2 import str2bool
 
 __all__ = ['Command']
 
diff --git a/kallithea/lib/paster_commands/cleanup.py b/kallithea/lib/paster_commands/cleanup.py
--- a/kallithea/lib/paster_commands/cleanup.py
+++ b/kallithea/lib/paster_commands/cleanup.py
@@ -28,7 +28,6 @@ Original author and date, and relevant c
 
 
 import os
-import sys
 import re
 import shutil
 import datetime
diff --git a/kallithea/lib/paster_commands/install_iis.py b/kallithea/lib/paster_commands/install_iis.py
--- a/kallithea/lib/paster_commands/install_iis.py
+++ b/kallithea/lib/paster_commands/install_iis.py
@@ -20,7 +20,6 @@ IIS installation tools for Kallithea
 
 
 import os
-import sys
 
 from kallithea.lib.paster_commands.common import BasePasterCommand
 
diff --git a/kallithea/lib/paster_commands/ishell.py b/kallithea/lib/paster_commands/ishell.py
--- a/kallithea/lib/paster_commands/ishell.py
+++ b/kallithea/lib/paster_commands/ishell.py
@@ -26,7 +26,6 @@ Original author and date, and relevant c
 """
 
 
-import os
 import sys
 
 # imports, used in IPython shell
diff --git a/kallithea/lib/paster_commands/make_index.py b/kallithea/lib/paster_commands/make_index.py
--- a/kallithea/lib/paster_commands/make_index.py
+++ b/kallithea/lib/paster_commands/make_index.py
@@ -28,7 +28,6 @@ Original author and date, and relevant c
 
 import os
 import sys
-from os.path import dirname
 
 from string import strip
 from kallithea.model.repo import RepoModel
diff --git a/kallithea/lib/paster_commands/make_rcextensions.py b/kallithea/lib/paster_commands/make_rcextensions.py
--- a/kallithea/lib/paster_commands/make_rcextensions.py
+++ b/kallithea/lib/paster_commands/make_rcextensions.py
@@ -27,7 +27,6 @@ Original author and date, and relevant c
 
 
 import os
-import sys
 import pkg_resources
 
 from kallithea.lib.paster_commands.common import ask_ok, BasePasterCommand
diff --git a/kallithea/lib/paster_commands/repo_scan.py b/kallithea/lib/paster_commands/repo_scan.py
--- a/kallithea/lib/paster_commands/repo_scan.py
+++ b/kallithea/lib/paster_commands/repo_scan.py
@@ -26,8 +26,6 @@ Original author and date, and relevant c
 """
 
 
-import os
-import sys
 
 from kallithea.model.scm import ScmModel
 from kallithea.lib.paster_commands.common import BasePasterCommand
diff --git a/kallithea/lib/paster_commands/setup_db.py b/kallithea/lib/paster_commands/setup_db.py
--- a/kallithea/lib/paster_commands/setup_db.py
+++ b/kallithea/lib/paster_commands/setup_db.py
@@ -19,9 +19,6 @@ Databaset setup gearbox command for Kall
 """
 
 
-import os
-import sys
-import paste.deploy
 
 import kallithea
 from kallithea.lib.db_manage import DbManage
diff --git a/kallithea/lib/paster_commands/update_repoinfo.py b/kallithea/lib/paster_commands/update_repoinfo.py
--- a/kallithea/lib/paster_commands/update_repoinfo.py
+++ b/kallithea/lib/paster_commands/update_repoinfo.py
@@ -26,14 +26,10 @@ Original author and date, and relevant c
 """
 
 
-import os
-import sys
-import string
 
 from kallithea.lib.paster_commands.common import BasePasterCommand
 from kallithea.lib.utils2 import safe_unicode
 from kallithea.model.db import Repository
-from kallithea.model.repo import RepoModel
 from kallithea.model.meta import Session
 
 


More information about the kallithea-general mailing list