def rebuild_index(self, dbdir):
        """Convert and index data files for random access.
           Index movie list for searching."""
        # Import and index data files
        if os.path.exists(self.dbfile):
            raise Exception('%s exists' % self.dbfile)
        for parsername, parser in parsers.parsers():
            obj = parser(dbfile=self.dbfile, dbdir=dbdir, debug=self.debug)
            if self.debug:
                print parsername % "Indexing %s..."
            with Timer(indent=2, quiet=not self.debug):
                obj.rebuild_index(do_copy=True)

        # Create index of movie titles
        if self.debug:
            print "Creating search index..."
        with Timer(indent=2, quiet=not self.debug):
            search.create_index(self.dbfile, dbdir, debug=self.debug)
dataset/ETHPy150Open nandhp/python-imdb/imdb/__init__.py/IMDb.rebuild_index/swapped operands of `%`