Skip to content

Commit

Permalink
whitespace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo van der Wijk committed Oct 4, 2012
1 parent 5bb6b6b commit c3351c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion nashvegas/management/commands/comparedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

NASHVEGAS = getattr(settings, "NASHVEGAS", {})


def ignorable_sql(line, level):
if level == 0:
return False # ignore nothing
return False # ignore nothing

# level 1 = ignore comments
if level > 0 and line.lstrip().startswith("--"):
Expand All @@ -25,10 +26,12 @@ def ignorable_sql(line, level):

return False


def normalize_sql(lines, level=1):
""" perform simple normalization: remove comments """
return [line for line in lines if not ignorable_sql(line, level)]


class Command(BaseCommand):

option_list = BaseCommand.option_list + (
Expand Down
5 changes: 3 additions & 2 deletions nashvegas/management/commands/syncdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.core.management.commands.syncdb import Command as SyncDBCommand
from optparse import make_option


class Command(SyncDBCommand):
option_list = SyncDBCommand.option_list + (
make_option('--skip-migrations',
Expand All @@ -10,14 +11,14 @@ class Command(SyncDBCommand):
default=True,
help='Skip nashvegas migrations, do traditional syncdb'),
)

def handle_noargs(self, **options):
# Run migrations first
if options.get("database"):
databases = [options.get("database")]
else:
databases = None
migrations = options.get('migrations')


if migrations:
call_command(
Expand All @@ -27,7 +28,7 @@ def handle_noargs(self, **options):
interactive=options.get("interactive"),
verbosity=options.get("verbosity"),
)

# Follow up with a syncdb on anything that wasnt included in migrations
# (this catches things like test-only models)
super(Command, self).handle_noargs(**options)

0 comments on commit c3351c8

Please sign in to comment.