def parse_movie(self): try: fields = list(self.fields_to_fetch) # make a copy self.initialize() if 'year' in fields: self.get_year() self.year = gutils.digits_only(self.year, 2100) fields.pop(fields.index('year')) if 'runtime' in fields: self.get_runtime() self.runtime = gutils.digits_only(self.runtime) fields.pop(fields.index('runtime')) if 'rating' in fields: self.get_rating() self.rating = gutils.digits_only(self.rating, 10) fields.pop(fields.index('rating')) if 'cast' in fields: self.get_cast() self.cast = gutils.clean(self.cast) if not isinstance(self.cast, unicode): self.cast = gutils.gdecode(self.cast, self.encode) fields.pop(fields.index('cast')) if 'plot' in fields: self.get_plot() self.plot = gutils.clean(self.plot) if not isinstance(self.plot, unicode): self.plot = gutils.gdecode(self.plot, self.encode) fields.pop(fields.index('plot')) if 'notes' in fields: self.get_notes() self.notes = gutils.clean(self.notes) if not isinstance(self.notes, unicode): self.notes = gutils.gdecode(self.notes, self.encode) fields.pop(fields.index('notes')) if 'image' in fields: self.get_image() self.fetch_picture() fields.pop(fields.index('image')) for i in fields: getattr(self, "get_%s" % i)() self[i] = gutils.clean(self[i]) if not isinstance(self[i], unicode): self[i] = gutils.gdecode(self[i], self.encode) if 'o_title' in self.fields_to_fetch and self.o_title is not None: if self.o_title[:4] == u'The ': self.o_title = self.o_title[4:] + u', The' if 'title' in self.fields_to_fetch and self.title is not None: if self.title[:4] == u'The ': self.title = self.title[4:] + u', The' except: log.exception('') finally: # close the progress dialog which was opened in get_movie self.progress.hide()
def parse_movie(self): try: fields = list(self.fields_to_fetch) # make a copy self.initialize() if "year" in fields: self.get_year() self.year = gutils.digits_only(self.year, 2100) fields.pop(fields.index("year")) if "runtime" in fields: self.get_runtime() self.runtime = gutils.digits_only(self.runtime) fields.pop(fields.index("runtime")) if "rating" in fields: self.get_rating() self.rating = gutils.digits_only(self.rating, 10) fields.pop(fields.index("rating")) if "cast" in fields: self.get_cast() self.cast = gutils.clean(self.cast) if not isinstance(self.cast, unicode): self.cast = gutils.gdecode(self.cast, self.encode) fields.pop(fields.index("cast")) if "plot" in fields: self.get_plot() self.plot = gutils.clean(self.plot) if not isinstance(self.plot, unicode): self.plot = gutils.gdecode(self.plot, self.encode) fields.pop(fields.index("plot")) if "notes" in fields: self.get_notes() self.notes = gutils.clean(self.notes) if not isinstance(self.notes, unicode): self.notes = gutils.gdecode(self.notes, self.encode) fields.pop(fields.index("notes")) if "image" in fields: self.get_image() self.fetch_picture() fields.pop(fields.index("image")) for i in fields: getattr(self, "get_%s" % i)() self[i] = gutils.clean(self[i]) if not isinstance(self[i], unicode): self[i] = gutils.gdecode(self[i], self.encode) if "o_title" in self.fields_to_fetch and self.o_title is not None: if self.o_title[:4] == u"The ": self.o_title = self.o_title[4:] + u", The" if "title" in self.fields_to_fetch and self.title is not None: if self.title[:4] == u"The ": self.title = self.title[4:] + u", The" finally: # close the progress dialog which was opened in get_movie self.progress.hide()
def parse_movie(self): from copy import deepcopy fields = deepcopy(self.fields_to_fetch) self.initialize() if "year" in fields: self.get_year() self.year = gutils.digits_only(self.year, 2100) fields.pop(fields.index("year")) if "runtime" in fields: self.get_runtime() self.runtime = gutils.digits_only(self.runtime) fields.pop(fields.index("runtime")) if "rating" in fields: self.get_rating() self.rating = gutils.digits_only(self.rating, 10) fields.pop(fields.index("rating")) if "cast" in fields: self.get_cast() self.cast = gutils.clean(self.cast) self.cast = gutils.gdecode(self.cast, self.encode) fields.pop(fields.index("cast")) if "plot" in fields: self.get_plot() self.plot = gutils.clean(self.plot) self.plot = gutils.gdecode(self.plot, self.encode) fields.pop(fields.index("plot")) if "notes" in fields: self.get_notes() self.notes = gutils.clean(self.notes) self.notes = gutils.gdecode(self.notes, self.encode) fields.pop(fields.index("notes")) if "image" in fields: self.get_image() self.fetch_picture() fields.pop(fields.index("image")) for i in fields: getattr(self, "get_%s" % i)() self[i] = gutils.clean(self[i]) self[i] = gutils.gdecode(self[i], self.encode) if "o_title" in self.fields_to_fetch and self.o_title is not None: if self.o_title[:4] == "The ": self.o_title = self.o_title[4:] + ", The" if "title" in self.fields_to_fetch and self.title is not None: if self.title[:4] == "The ": self.title = self.title[4:] + ", The"
def parse_movie(self): from copy import deepcopy fields = deepcopy(self.fields_to_fetch) self.initialize() if 'year' in fields: self.get_year() self.year = gutils.digits_only(self.year, 2100) fields.pop(fields.index('year')) if 'runtime' in fields: self.get_runtime() self.runtime = gutils.digits_only(self.runtime) fields.pop(fields.index('runtime')) if 'rating' in fields: self.get_rating() self.rating = gutils.digits_only(self.rating, 10) fields.pop(fields.index('rating')) if 'cast' in fields: self.get_cast() self.cast = gutils.clean(self.cast) self.cast = gutils.gdecode(self.cast, self.encode) fields.pop(fields.index('cast')) if 'plot' in fields: self.get_plot() self.plot = gutils.clean(self.plot) self.plot = gutils.gdecode(self.plot, self.encode) fields.pop(fields.index('plot')) if 'notes' in fields: self.get_notes() self.notes = gutils.clean(self.notes) self.notes = gutils.gdecode(self.notes, self.encode) fields.pop(fields.index('notes')) if 'image' in fields: self.get_image() self.fetch_picture() fields.pop(fields.index('image')) for i in fields: getattr(self, "get_%s" % i)() self[i] = gutils.clean(self[i]) self[i] = gutils.gdecode(self[i], self.encode) if 'o_title' in self.fields_to_fetch and self.o_title is not None: if self.o_title[:4] == 'The ': self.o_title = self.o_title[4:] + ', The' if 'title' in self.fields_to_fetch and self.title is not None: if self.title[:4] == 'The ': self.title = self.title[4:] + ', The'