Changeset - 0e0dbb16fcbf
[Not reviewed]
default
1 2 1
Thomas De Schampheleire - 7 years ago 2018-11-18 20:02:17
thomas.de_schampheleire@nokia.com
cli: convert 'gearbox ishell' into 'kallithea-cli ishell'
3 files changed with 17 insertions and 28 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli.py
Show inline comments
 
@@ -14,6 +14,7 @@
 

	
 
# 'cli' is the main entry point for 'kallithea-cli', specified in setup.py as entry_points console_scripts
 
from kallithea.bin.kallithea_cli_base import cli
 

	
 
# import commands (they will add themselves to the 'cli' object)
 
import kallithea.bin.kallithea_cli_config
 
import kallithea.bin.kallithea_cli_ishell
kallithea/bin/kallithea_cli_ishell.py
Show inline comments
 
file renamed from kallithea/lib/paster_commands/ishell.py to kallithea/bin/kallithea_cli_ishell.py
 
@@ -9,44 +9,33 @@
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
"""
 
kallithea.lib.paster_commands.ishell
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
interactive shell gearbox command for Kallithea
 

	
 
This file was forked by the Kallithea project in July 2014.
 
This file was forked by the Kallithea project in July 2014 and later moved.
 
Original author and date, and relevant copyright and licensing information is below:
 
:created_on: Apr 4, 2013
 
:author: marcink
 
:copyright: (c) 2013 RhodeCode GmbH, and others.
 
:license: GPLv3, see LICENSE.md for more details.
 
"""
 

	
 
import click
 
import kallithea.bin.kallithea_cli_base as cli_base
 

	
 
import sys
 

	
 
# imports, used in IPython shell
 
import time
 
import shutil
 
import datetime
 
# make following imports directly available inside the ishell
 
from kallithea.model.db import *
 

	
 
from kallithea.lib.paster_commands.common import BasePasterCommand
 

	
 

	
 
class Command(BasePasterCommand):
 
    "Kallithea: Interactive Python shell"
 

	
 
    def take_action(self, args):
 
        try:
 
            from IPython import embed
 
        except ImportError:
 
            print 'Kallithea ishell requires the Python package IPython 4 or later'
 
            sys.exit(-1)
 
        from traitlets.config.loader import Config
 
        cfg = Config()
 
        cfg.InteractiveShellEmbed.confirm_exit = False
 
        embed(config=cfg, banner1="Kallithea IShell.")
 
@cli_base.register_command(config_file_initialize_app=True)
 
def ishell():
 
    """Interactive shell for Kallithea."""
 
    try:
 
        from IPython import embed
 
    except ImportError:
 
        print 'Kallithea ishell requires the Python package IPython 4 or later'
 
        sys.exit(-1)
 
    from traitlets.config.loader import Config
 
    cfg = Config()
 
    cfg.InteractiveShellEmbed.confirm_exit = False
 
    embed(config=cfg, banner1="Kallithea IShell.")
setup.py
Show inline comments
 
@@ -160,13 +160,12 @@ setuptools.setup(
 

	
 
    [gearbox.commands]
 
    cache-keys=kallithea.lib.paster_commands.cache_keys:Command
 
    celeryd=kallithea.lib.paster_commands.celeryd:Command
 
    cleanup-repos=kallithea.lib.paster_commands.cleanup:Command
 
    install-iis=kallithea.lib.paster_commands.install_iis:Command
 
    ishell=kallithea.lib.paster_commands.ishell:Command
 
    make-index=kallithea.lib.paster_commands.make_index:Command
 
    make-rcext=kallithea.lib.paster_commands.make_rcextensions:Command
 
    repo-scan=kallithea.lib.paster_commands.repo_scan:Command
 
    setup-db=kallithea.lib.paster_commands.setup_db:Command
 
    update-repoinfo=kallithea.lib.paster_commands.update_repoinfo:Command
 
    upgrade-db=kallithea.lib.dbmigrate:UpgradeDb
0 comments (0 inline, 0 general)