summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolly <olly@ollycope.com>2013-12-09 11:54:40 +0100
committerolly <olly@ollycope.com>2013-12-09 11:54:40 +0100
commit3823a98ad50098e5ee41f7ff9517326756afb451 (patch)
treefdff92d46e3456a0a142fd8820da8e7ef7bf85c6
parentf0969f35b10edb73bbbc76c6ca9e109c68bce3bb (diff)
downloadyoyo-3823a98ad50098e5ee41f7ff9517326756afb451.tar.gz
Use print_function for python3 compatibility
-rw-r--r--yoyo/scripts/migrate.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/yoyo/scripts/migrate.py b/yoyo/scripts/migrate.py
index 2ad1600..4fa7a8e 100644
--- a/yoyo/scripts/migrate.py
+++ b/yoyo/scripts/migrate.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import logging
import optparse
import os
@@ -70,26 +71,26 @@ def prompt_migrations(conn, paramstyle, migrations, direction):
options = ''.join(o.upper() if o == choice else o.lower()
for o in 'ynvdaqjk?')
- print ""
- print '[%s]' % (mig.migration.id,)
+ print("")
+ print('[%s]' % (mig.migration.id,))
response = prompt("Shall I %s this migration?" % (direction,), options)
if response == '?':
- print ""
- print "y: %s this migration" % (direction,)
- print "n: don't %s it" % (direction,)
- print ""
- print "v: view this migration in full"
- print ""
- print "d: %s the selected migrations, skipping any remaining" % \
- (direction,)
- print "a: %s all the remaining migrations" % (direction,)
- print "q: cancel without making any changes"
- print ""
- print "j: skip to next migration"
- print "k: back up to previous migration"
- print ""
- print "?: show this help"
+ print("")
+ print("y: %s this migration" % (direction,))
+ print("n: don't %s it" % (direction,))
+ print("")
+ print("v: view this migration in full")
+ print("")
+ print("d: %s the selected migrations, skipping any remaining" %
+ (direction,))
+ print("a: %s all the remaining migrations" % (direction,))
+ print("q: cancel without making any changes")
+ print("")
+ print("j: skip to next migration")
+ print("k: back up to previous migration")
+ print("")
+ print("?: show this help")
continue
if response in 'yn':
@@ -98,7 +99,7 @@ def prompt_migrations(conn, paramstyle, migrations, direction):
continue
if response == 'v':
- print mig.migration.source
+ print(mig.migration.source)
continue
if response == 'j':