Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Sep 25, 2018
1 parent eaf03e6 commit d8dcdc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ckan/cli/db.py
Expand Up @@ -40,7 +40,7 @@ def cleandb():
model.repo.clean_db()
except Exception as e:
click.echo(e, err=True)
click.secho(u'Cleaning DB: SUCCESS', color="green", bold=True)
click.secho(u'Cleaning DB: SUCCESS', color=u"green", bold=True)


@db.command(u'upgrade', short_help=u'Upgrade the database')
Expand All @@ -53,7 +53,7 @@ def updatedb(version=None):
model.repo.upgrade_db(version)
except Exception as e:
click.echo(e, err=True)
click.secho(u'Upgrading DB: SUCCESS', fg='green', bold=True)
click.secho(u'Upgrading DB: SUCCESS', fg=u'green', bold=True)


@db.command(u'version', short_help=u'Returns current version of data schema')
Expand All @@ -65,6 +65,6 @@ def version():
ver = Session.execute(u'select version from '
u'migrate_version;').fetchall()
click.secho(u"Latest data schema version: {0}".format(ver[0][0]),
fg="green", bold=True)
fg=u"green", bold=True)
except Exception as e:
click.echo(e, err=True)
5 changes: 1 addition & 4 deletions ckan/cli/search_index.py
Expand Up @@ -94,15 +94,12 @@ def rebuild_fast(ctx):
package_ids.append(row[0])

def start(ids):
## load actual enviroment for each subprocess, so each have thier own
## sa session
from ckan.lib.search import rebuild, commit
rebuild(package_ids=ids)
commit()

def chunks(l, n):
u""" Yield n successive chunks from l.
u"""
u""" Yield n successive chunks from l."""
newn = int(len(l) / n)
for i in xrange(0, n-1):
yield l[i*newn:i*newn+newn]
Expand Down

0 comments on commit d8dcdc5

Please sign in to comment.