Skip to content

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Oct 3, 2018
1 parent 1b85c23 commit 5e58451
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions ckan/cli/__init__.py
Expand Up @@ -28,6 +28,7 @@

def load_config(config=None):

import pdb; pdb.set_trace()
from paste.deploy import appconfig
from paste.script.util.logging_config import fileConfig
log.info("Searching for configuration file")
Expand Down
14 changes: 8 additions & 6 deletions ckan/cli/cli.py
Expand Up @@ -4,7 +4,7 @@

import click

from ckan.cli import db, load_config, click_config_option, search_index, server
from ckan.cli import db, load_config, search_index, server
from ckan.config.middleware import make_app

import logging
Expand All @@ -22,18 +22,20 @@

class CkanCommand(object):

def __init__(self, config=None):
self.config = load_config(config)
def __init__(self, conf=None):
self.config = load_config(conf)
self.app = make_app(self.config.global_conf, **self.config.local_conf)


@click.group()
@click.help_option(u'-h', u'--help')
@click_config_option
@click.option(u'--conf', envvar=u'CKANINI',
type=click.File())
@click.pass_context
def ckan(ctx, config, *args, **kwargs):
def ckan(ctx, conf, *args, **kwargs):
log.info(u'Loading configuration')
ctx.obj = CkanCommand(config)
import pdb; pdb.set_trace()
ctx.obj = CkanCommand(conf)


ckan.add_command(server.run)
Expand Down
4 changes: 2 additions & 2 deletions ckan/cli/server.py
Expand Up @@ -6,7 +6,7 @@
from flask import Flask, current_app
from werkzeug.serving import run_simple

from ckan.cli import load_config, click_config_option
from ckan.cli import click_config_option


@click.command(u'run', short_help=u'Start development server')
Expand All @@ -16,7 +16,7 @@
@click.option(u'-p', u'--port', default=5000, help=u'Set port')
@click.option(u'-r', u'--reloader', default=True, help=u'Use reloader')
@click.pass_context
def run(ctx, config, host, port, reloader):
def run(ctx, host, port, reloader):
u'''Runs development server'''
# click.secho(u"Starting CKAN", fg='yellow')
run_simple(host, port, ctx.obj.app, use_reloader=reloader, use_evalex=True)

0 comments on commit 5e58451

Please sign in to comment.