示例#1
0
def get_from_web(self):
	"""search the movie in web using the active plugin"""
	title = self.widgets['add']['title'].get_text()
	o_title = self.widgets['add']['o_title'].get_text()

	if o_title or title:
		option = gutils.on_combo_box_entry_changed_name(self.widgets['add']['source'])
		self.active_plugin = option
		plugin_name = 'PluginMovie%s' % option
		plugin = __import__(plugin_name)
		self.search_movie = plugin.SearchPlugin()
		if o_title:
			self.search_movie.url = self.search_movie.original_url_search
			self.search_movie.title = gutils.remove_accents(o_title, 'utf-8')
		elif title:
			self.search_movie.url = self.search_movie.translated_url_search
			self.search_movie.title = gutils.remove_accents(title, 'utf-8')
		self.search_movie.search(self.widgets['add']['window'])
		self.search_movie.get_searches()
		if len(self.search_movie.ids) == 1 and o_title and title:
			self.search_movie.url = self.search_movie.translated_url_search
			self.search_movie.title = gutils.remove_accents(title, 'utf-8')
			self.search_movie.search(self.widgets['add']['window'])
			self.search_movie.get_searches()
		self.show_search_results(self.search_movie)
	else:
		gutils.error(self.widgets['results']['window'], \
			_("You should fill the original title\nor the movie title."))
示例#2
0
def get_from_web(self):
    """search the movie in web using the active plugin"""

    title = self.widgets['add']['title'].get_text()
    o_title = self.widgets['add']['o_title'].get_text()

    if o_title or title:
        option = gutils.on_combo_box_entry_changed_name(
            self.widgets['add']['source'])
        self.active_plugin = option
        plugin_name = 'PluginMovie%s' % option
        plugin = __import__(plugin_name)
        if self.debug_mode:
            log.debug('reloading %s', plugin_name)
            import sys
            reload(sys.modules[plugin_name])
        self.search_movie = plugin.SearchPlugin()
        self.search_movie.config = self.config
        self.search_movie.locations = self.locations
        if o_title:
            self.search_movie.url = self.search_movie.original_url_search
            if self.search_movie.remove_accents:
                self.search_movie.title = gutils.remove_accents(
                    o_title, 'utf-8')
            else:
                self.search_movie.title = unicode(o_title, 'utf-8')
        elif title:
            self.search_movie.url = self.search_movie.translated_url_search
            if self.search_movie.remove_accents:
                self.search_movie.title = gutils.remove_accents(title, 'utf-8')
            else:
                self.search_movie.title = unicode(title, 'utf-8')
        # check if internet connection is available
        try:
            urllib2.urlopen(self.search_movie.url)
            if self.search_movie.search_movies(self.widgets['add']['window']):
                self.search_movie.get_searches()
            if len(self.search_movie.ids) == 1 and o_title and title:
                self.search_movie.url = self.search_movie.translated_url_search
                if self.search_movie.remove_accents:
                    self.search_movie.title = gutils.remove_accents(
                        title, 'utf-8')
                else:
                    self.search_movie.title = unicode(title, 'utf-8')
                if self.search_movie.search_movies(
                        self.widgets['add']['window']):
                    self.search_movie.get_searches()
            self.show_search_results(self.search_movie)
        except:
            log.exception('')
            gutils.error(_("Connection failed."))
    else:
        gutils.error(
            _("You should fill the original title\nor the movie title."))
示例#3
0
def source_changed(self):
	option = gutils.on_combo_box_entry_changed_name(self.widgets['add']['source'])
	self.active_plugin = option
	plugin_name = 'PluginMovie' + option
	plugin = __import__(plugin_name)
	self.widgets['add']['plugin_desc'].set_text(plugin.plugin_name+"\n" \
		+plugin.plugin_description+"\n"+_("Url: ") \
		+plugin.plugin_url+"\n"+_("Language: ")+plugin.plugin_language)
	image = os.path.join(self.locations['images'], plugin_name + ".png")
	# if movie plugin logo exists lets use it
	if os.path.exists(image):
		handler = self.widgets['add']['plugin_image'].set_from_pixbuf(gtk.gdk.pixbuf_new_from_file(image))
示例#4
0
def source_changed(self):
    option = gutils.on_combo_box_entry_changed_name(
        self.widgets['add']['source'])
    self.active_plugin = option
    plugin_name = 'PluginMovie' + option
    plugin = __import__(plugin_name)
    self.widgets['add']['plugin_desc'].set_text(plugin.plugin_name + "\n" \
        + plugin.plugin_description + "\n" + _('Url: ') \
        + plugin.plugin_url + "\n" + _('Language: ') + plugin.plugin_language)
    image = os.path.join(self.locations['images'], plugin_name + ".png")
    # if movie plugin logo exists lets use it
    if os.path.exists(image):
        handler = self.widgets['add']['plugin_image'].set_from_pixbuf(
            gtk.gdk.pixbuf_new_from_file(image))
示例#5
0
def get_from_web(self):
    """search the movie in web using the active plugin"""
        
    title = self.widgets['add']['title'].get_text()
    o_title = self.widgets['add']['o_title'].get_text()

    if o_title or title:
        option = gutils.on_combo_box_entry_changed_name(self.widgets['add']['source'])
        self.active_plugin = option
        plugin_name = 'PluginMovie%s' % option
        plugin = __import__(plugin_name)
        if self.debug_mode:
            log.debug('reloading %s', plugin_name)
            import sys
            reload(sys.modules[plugin_name])
        self.search_movie = plugin.SearchPlugin()
        self.search_movie.config = self.config
        self.search_movie.locations = self.locations
        if o_title:
            self.search_movie.url = self.search_movie.original_url_search
            if self.search_movie.remove_accents:
                self.search_movie.title = gutils.remove_accents(o_title, 'utf-8')
            else:
                self.search_movie.title = unicode(o_title, 'utf-8')
        elif title:
            self.search_movie.url = self.search_movie.translated_url_search
            if self.search_movie.remove_accents:
                self.search_movie.title = gutils.remove_accents(title, 'utf-8')
            else:
                self.search_movie.title = unicode(title, 'utf-8')
        # check if internet connection is available
        try:
            urllib2.urlopen("http://www.griffith.cc")
            if self.search_movie.search_movies(self.widgets['add']['window']):
                self.search_movie.get_searches()
            if len(self.search_movie.ids) == 1 and o_title and title:
                self.search_movie.url = self.search_movie.translated_url_search
                if self.search_movie.remove_accents:
                    self.search_movie.title = gutils.remove_accents(title, 'utf-8')
                else:
                    self.search_movie.title = unicode(title, 'utf-8')
                if self.search_movie.search_movies(self.widgets['add']['window']):
                    self.search_movie.get_searches()
            self.show_search_results(self.search_movie)
        except:
            log.exception('')
            gutils.error(_("Connection failed."))
    else:
        gutils.error(_("You should fill the original title\nor the movie title."))
示例#6
0
def get_from_web(self):
	"""search the movie in web using the active plugin"""
	if len(self.am_original_title.get_text()) \
		or len(self.am_title.get_text()):
		option = gutils.on_combo_box_entry_changed_name(self.am_source)
		self.active_plugin = option
		plugin_name = 'PluginMovie%s' % option
		plugin = __import__(plugin_name)
		self.search_movie = plugin.SearchPlugin()
		if len(self.am_original_title.get_text()):
			self.search_movie.url = self.search_movie.original_url_search
			self.search_movie.title = \
				gutils.remove_accents(self.am_original_title.get_text(), 'utf-8')
		elif len(self.am_title.get_text()) \
			and not len(self.am_original_title.get_text()):
			self.search_movie.url = self.search_movie.translated_url_search
			self.search_movie.title = \
				gutils.remove_accents(self.am_title.get_text(), 'utf-8')
		self.search_movie.search(self.add_movie_window)
		self.search_movie.get_searches()
		self.show_search_results(self.search_movie)
	else:
		gutils.error(self.w_results, \
			_("You should fill the original title\nor the movie title."))