changeset 6162:9c5f794df7cd

paster: drop insertion of root path in sys.path Most paster commands inserted the root of the kallithea app in sys.path ... but only after loading all the Kallithea modules. That seems a bit pointless.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 06 Sep 2016 00:51:18 +0200
parents 4bcaf1ca2e08
children e7b18393450a
files kallithea/lib/paster_commands/cache_keys.py kallithea/lib/paster_commands/cleanup.py kallithea/lib/paster_commands/install_iis.py kallithea/lib/paster_commands/ishell.py kallithea/lib/paster_commands/make_index.py kallithea/lib/paster_commands/make_rcextensions.py kallithea/lib/paster_commands/repo_scan.py kallithea/lib/paster_commands/setup_db.py kallithea/lib/paster_commands/update_repoinfo.py
diffstat 9 files changed, 0 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/paster_commands/cache_keys.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/cache_keys.py	Tue Sep 06 00:51:18 2016 +0200
@@ -35,11 +35,6 @@
 from kallithea.lib.utils2 import safe_str
 from kallithea.model.db import CacheInvalidation
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(BasePasterCommand):
 
--- a/kallithea/lib/paster_commands/cleanup.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/cleanup.py	Tue Sep 06 00:51:18 2016 +0200
@@ -38,11 +38,6 @@
 from kallithea.lib.utils2 import safe_str
 from kallithea.model.db import Ui
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(BasePasterCommand):
 
--- a/kallithea/lib/paster_commands/install_iis.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/install_iis.py	Tue Sep 06 00:51:18 2016 +0200
@@ -24,10 +24,6 @@
 from paste.script.appinstall import AbstractInstallCommand
 from paste.script.command import BadCommand
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
 
 class Command(AbstractInstallCommand):
     default_verbosity = 1
--- a/kallithea/lib/paster_commands/ishell.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/ishell.py	Tue Sep 06 00:51:18 2016 +0200
@@ -31,11 +31,6 @@
 
 from kallithea.lib.paster_commands.common import BasePasterCommand
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(BasePasterCommand):
 
--- a/kallithea/lib/paster_commands/make_index.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/make_index.py	Tue Sep 06 00:51:18 2016 +0200
@@ -34,11 +34,6 @@
 from kallithea.lib.paster_commands.common import BasePasterCommand
 from kallithea.lib.utils import load_rcextensions
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(BasePasterCommand):
 
--- a/kallithea/lib/paster_commands/make_rcextensions.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/make_rcextensions.py	Tue Sep 06 00:51:18 2016 +0200
@@ -32,11 +32,6 @@
 
 from kallithea.lib.paster_commands.common import ask_ok, BasePasterCommand
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(BasePasterCommand):
 
--- a/kallithea/lib/paster_commands/repo_scan.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/repo_scan.py	Tue Sep 06 00:51:18 2016 +0200
@@ -33,11 +33,6 @@
 from kallithea.lib.paster_commands.common import BasePasterCommand
 from kallithea.lib.utils import repo2db_mapper
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(BasePasterCommand):
 
--- a/kallithea/lib/paster_commands/setup_db.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/setup_db.py	Tue Sep 06 00:51:18 2016 +0200
@@ -25,11 +25,6 @@
 from paste.script.command import BadCommand
 from paste.deploy import appconfig
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(AbstractInstallCommand):
 
--- a/kallithea/lib/paster_commands/update_repoinfo.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/lib/paster_commands/update_repoinfo.py	Tue Sep 06 00:51:18 2016 +0200
@@ -36,11 +36,6 @@
 from kallithea.model.repo import RepoModel
 from kallithea.model.meta import Session
 
-# Add location of top level folder to sys.path
-from os.path import dirname
-rc_path = dirname(dirname(dirname(os.path.realpath(__file__))))
-sys.path.append(rc_path)
-
 
 class Command(BasePasterCommand):