Пример #1
0
    def startProcess(self, movies, length):
        stats = {"added": 0, "updated": 0, "removed": 0}

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not(HIDE_TOP250) and self.progress.iscanceled()):
                break

            result = self.checkMovie(movie)
            if result != None:
                stats[result] += 1

            if not(HIDE_TOP250):
                self.progress.update((count * 100) // length, "%s %s" % (l("Searching_for"), movie["label"]))
        else:
            util.writeDate("top250")
            self.createMissingCSV()
            if OPEN_MISSING:
                util.openFile("missingTop250.csv")

        stats["missing"] = len(self.top250)
        util.log("Movies IMDb Top250 summary: updated: %(updated)s, added: %(added)s, removed: %(removed)s, missing: %(missing)s" % stats)

        if HIDE_TOP250:
            util.notification("%s %s" % (l("Completed"), l("Top250")))
        else:
            util.dialogOk(l("Completed"), l("Movies_IMDb_Top250_summary"), "%s %s" % (stats["updated"], l("were_updated")), "%s %s %s %s" % (stats["added"], l("were_added_and"), stats["removed"], l("were_removed!")))
Пример #2
0
    def startProcess(self, movies, length):
        stats = {"added": 0, "updated": 0, "removed": 0}

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not (HIDE_TOP250)
                                         and self.progress.iscanceled()):
                break

            result = self.checkMovie(movie)
            if result != None:
                stats[result] += 1

            if not (HIDE_TOP250):
                self.progress.update(
                    (count * 100) // length,
                    "%s %s" % (l("Searching_for"), movie["label"]))
        else:
            util.writeDate("top250")
            self.createMissingCSV()
            if OPEN_MISSING:
                util.openFile("missingTop250.csv")

        stats["missing"] = len(self.top250)
        util.log(
            "Movies IMDb Top250 summary: updated: %(updated)s, added: %(added)s, removed: %(removed)s, missing: %(missing)s"
            % stats)

        if HIDE_TOP250:
            util.notification("%s %s" % (l("Completed"), l("Top250")))
        else:
            util.dialogOk(
                l("Completed"), l("Movies_IMDb_Top250_summary"),
                "%s %s" % (stats["updated"], l("were_updated")),
                "%s %s %s %s" % (stats["added"], l("were_added_and"),
                                 stats["removed"], l("were_removed!")))
Пример #3
0
    def startProcess(self, movies, total):
        updated = 0
        resume = self.getResume()

        if HIDE_MOVIES:
            util.notification(util.l("Started_updating_movies_ratings"))
        else:
            progress = util.dialogProgress()

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not(HIDE_MOVIES) and progress.iscanceled()):
                self.writeResume(count)
                break
            if count >= resume:
                if not(HIDE_MOVIES):
                    progress.update((count * 100) // total, "%s %s" % (util.l("Searching_for"), movie["label"]))
                updated += self.updateMovie(movie)
        else:
            util.deleteF("resume_movies")
            util.writeDate("movies")

        text = "%s: %s %s %s %s!" % (util.l("Movies_ratings_summary"), updated, util.l("of"), total, util.l("were_updated"))
        util.log(text)

        if HIDE_MOVIES:
            util.notification(text)
        else:
            progress.close()
            util.dialogOk(util.l("Completed"), text)
Пример #4
0
    def startProcess(self, movies, total):
        global FORM_MPAA
        updated = 0

        if HIDE_MPAA:
            util.notification(l("Started_updating_movies_ratings"))
        else:
            progress = util.dialogProgress()

        website = "altersfreigaben.de"
        if LANG_MPAA == "de":
            if not CHANGED_PREFIX:
                FORM_MPAA = "germany:"
        if LANG_MPAA == "us":
            if not CHANGED_PREFIX:
                FORM_MPAA = "Rated"
        if LANG_MPAA == "au":
            if not CHANGED_PREFIX:
                FORM_MPAA = "australia:"
        if LANG_MPAA == "nl":
            if not CHANGED_PREFIX:
                FORM_MPAA = "Rated"

        httphandler = httplib.HTTPConnection(website)

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not (HIDE_MPAA)
                                         and progress.iscanceled()):
                break

            if not (HIDE_MPAA):
                progress.update((count * 100) // total,
                                "%s %s" % (l("Searching_for"), movie["label"]))

            updated += self.updateMovie(movie, httphandler, LANG_MPAA)
        else:
            util.writeDate("mpaa")

        text = "%s: %s %s %s %s!" % (l("Movies_ratings_summary"), updated,
                                     l("of"), total, l("were_updated"))
        util.log(text)

        if HIDE_MPAA:
            util.notification(text)
        else:
            progress.close()
            util.dialogOk(l("Completed"), text)
Пример #5
0
    def startProcess(self, movies, total):
        global FORM_MPAA
        updated = 0

        if HIDE_MPAA:
            util.notification(l("Started_updating_movies_ratings"))
        else:
            progress = util.dialogProgress()

        website = "altersfreigaben.de"
        if LANG_MPAA == "de":
            if not CHANGED_PREFIX:
               FORM_MPAA = "germany:"
        if LANG_MPAA == "us":
            if not CHANGED_PREFIX:
               FORM_MPAA = "Rated"
        if LANG_MPAA == "au":
            if not CHANGED_PREFIX:
               FORM_MPAA = "australia:"
        if LANG_MPAA == "nl":
            if not CHANGED_PREFIX:
               FORM_MPAA = "Rated"

        httphandler = httplib.HTTPConnection(website)

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not(HIDE_MPAA) and progress.iscanceled()):
                break

            if not(HIDE_MPAA):
                progress.update((count * 100) // total, "%s %s" % (l("Searching_for"), movie["label"]))

            updated += self.updateMovie(movie, httphandler, LANG_MPAA)
        else:
            util.writeDate("mpaa")

        text = "%s: %s %s %s %s!" % (l("Movies_ratings_summary"), updated, l("of"), total, l("were_updated"))
        util.log(text)

        if HIDE_MPAA:
            util.notification(text)
        else:
            progress.close()
            util.dialogOk(l("Completed"), text)