Permalink
Browse files

fix print and input statements

  • Loading branch information...
1 parent e0e48f5 commit f33ae2e2ec2ac2c5403e8a1b202ed2ae2538c6b6 @Fantomas42 committed Apr 10, 2013
@@ -7,6 +7,7 @@
from django.conf import settings
from django.utils import timezone
+from django.utils.six.moves import input
from django.utils.encoding import smart_str
from django.contrib.sites.models import Site
from django.template.defaultfilters import slugify
@@ -80,7 +81,7 @@ def handle_noargs(self, **options):
'Starting migration from Blogger to Zinnia %s\n' % __version__))
if not self.blogger_username:
- self.blogger_username = raw_input('Blogger username: ')
+ self.blogger_username = input('Blogger username: ')
if not self.blogger_username:
raise CommandError('Invalid Blogger username')
@@ -107,7 +108,7 @@ def handle_noargs(self, **options):
self.select_blog_id()
if not self.category_title:
- self.category_title = raw_input(
+ self.category_title = input(
'Category title for imported entries: ')
if not self.category_title:
raise CommandError('Invalid category title')
@@ -126,7 +127,7 @@ def select_blog_id(self):
self.write_out('%s. %s (%s)' % (i, blog.title.text,
get_blog_id(blog)))
try:
- blog_index = int(raw_input('\nSelect a blog to import: '))
+ blog_index = int(input('\nSelect a blog to import: '))
blog = blogs[blog_index]
break
except (ValueError, KeyError):
@@ -24,4 +24,4 @@ def handle_noargs(self, **options):
spams.delete()
if verbosity:
- print '%i spam comments deleted.' % spams_count
+ print('%i spam comments deleted.' % spams_count)
@@ -11,6 +11,7 @@
from django.core.files import File
from django.utils.text import Truncator
from django.utils.html import strip_tags
+from django.utils.six.moves import input
from django.db.utils import IntegrityError
from django.utils.encoding import smart_str
from django.contrib.sites.models import Site
@@ -143,7 +144,7 @@ def migrate_author(self, author_name):
"2. Create a new user ?\n"\
"Please select a choice: " % self.style.ITEM(author_name)
while 42:
- selection = raw_input(smart_str(action_text))
+ selection = input(smart_str(action_text))
if selection and selection in '12':
break
if selection == '1':
@@ -171,7 +172,7 @@ def migrate_author(self, author_name):
"%s or 'back'\n"\
"Please select a choice: " % \
', '.join(usernames_display)
- user_selected = raw_input(user_text)
+ user_selected = input(user_text)
if user_selected in usernames:
break
if user_selected == '' and preselected_user:
@@ -183,7 +184,7 @@ def migrate_author(self, author_name):
else:
create_text = "2. Please type the email of " \
"the '%s' user or 'back': " % author_name
- author_mail = raw_input(create_text)
+ author_mail = input(create_text)
if author_mail.strip() == 'back':
return self.migrate_author(author_name)
try:
@@ -28,4 +28,4 @@ def handle_noargs(self, **options):
'site': site,
'site_url': '%s://%s' % (PROTOCOL, site.domain)}
export = render_to_string('zinnia/wxr.xml', blog_context)
- print smart_str(export)
+ print(smart_str(export))

0 comments on commit f33ae2e

Please sign in to comment.