def determine_forum(self):
        forums = self.get_value_from_api('get_forum_list')

        if len(forums) == 0:
            sys.exit('You have no forums on Disqus!')
        elif len(forums) == 1:
            forum_id = forums[0]['id']
        else:
            possible_ids = tuple(forum['id'] for forum in forums)
            forum_id = None
            while forum_id not in possible_ids:
                if forum_id is not None:
                    print 'Invalid forum ID.  Please try again.'

                print 'You have the following forums on Disqus:\n'

                for forum in forums:
                    print '\t%s. %s' % (forum['id'], forum['name'])

                forum_id = raw_input('\nInto which forum do you want to import your existing comments? ')

        return forum_id
dataset/ETHPy150Open codekoala/django-articles/articles/management/commands/convert_comments_to_disqus.py/Command.determine_forum/original