Esempio n. 1
0
    def __init__(self):
        AddonHelper.__init__(self, 'plugin.image.picasa')
        self._api = None
        self.pfilter = None
        self.privacy_levels = ['public', 'private', 'protected']

        if self.getSetting('use_login') == 'true':
            self.user = '******'
        else:
            self.user = self.getSetting('login_email').split('@')[0]

        cache_path = self.dataPath('cache')
        if not os.path.exists(cache_path): os.makedirs(cache_path)

        mpp = self.getSettingInt('max_per_page')
        self.max_per_page = [10, 20, 30, 40, 50, 75, 100, 200, 500, 1000][mpp]

        update_dir = False
        cache = True

        success = self.go(
            self.getParamInt('mode', None), self.getParamString('url', None),
            self.getParamString('name', None),
            self.getParamString('user', self.user, no_unquote=True))

        if self.getParamInt('start_index', None): update_dir = True
        self.endOfDirectory(succeeded=success,
                            updateListing=update_dir,
                            cacheToDisc=cache)
Esempio n. 2
0
	def __init__(self):
		AddonHelper.__init__(self,'plugin.image.picasa')
		self._api = None
		self.pfilter = None
		self.privacy_levels = ['public','private','protected']
		
		if self.getSetting('use_login') == 'true':
			self.user = '******'
		else:
			self.user = self.getSetting('login_email').split('@')[0]
		
		cache_path = self.dataPath('cache')
		if not os.path.exists(cache_path): os.makedirs(cache_path)
		
		mpp = self.getSettingInt('max_per_page')
		self.max_per_page = [10,20,30,40,50,75,100,200,500,1000][mpp]
		
		update_dir = False
		cache = True
	
		success = self.go(	self.getParamInt('mode',None),
							self.getParamString('url',None),
							self.getParamString('name',None),
							self.getParamString('user',self.user,no_unquote=True))
		
		if self.getParamInt('start_index',None): update_dir = True
		self.endOfDirectory(succeeded=success,updateListing=update_dir,cacheToDisc=cache)
Esempio n. 3
0
    def __init__(self, show_image=False):
        AddonHelper.__init__(self, "plugin.image.picasa")
        if show_image:
            return self.showImage()
        self._api = None
        self.pfilter = None
        self.privacy_levels = ["public", "private", "protected"]

        if self.getSetting("use_login") == "true":
            self.user = "******"
        else:
            self.user = self.getSetting("login_email").split("@")[0]

        cache_path = self.dataPath("cache")
        if not os.path.exists(cache_path):
            os.makedirs(cache_path)

        mpp = self.getSettingInt("max_per_page")
        self.max_per_page = [10, 20, 30, 40, 50, 75, 100, 200, 500, 1000][mpp]
        self.isSlideshow = self.getParamString("plugin_slideshow_ss", "false") == "true"
        print "plugin.image.picasa: isSlideshow: %s" % self.isSlideshow

        update_dir = False
        cache = True

        success = self.go(
            self.getParamInt("mode", None),
            self.getParamString("url", None),
            self.getParamString("name", None),
            self.getParamString("user", self.user, no_unquote=True),
        )

        if self.getParamInt("start_index", None):
            update_dir = True
        self.endOfDirectory(succeeded=success, updateListing=update_dir, cacheToDisc=cache)
Esempio n. 4
0
	def __init__(self):
		AddonHelper.__init__(self,'plugin.image.picasa-desktop')
		
		if self.getSettingInt('db_location') == 0:
			# default local picasa db
			if os.name == 'nt':
				db_path = "file://" + os.path.join(os.getenv('USERPROFILE'), 'appdata', 'Local', 'Google', 'Picasa2Albums')
			elif os.name == 'posix':
				db_path = "file://" + os.path.join(os.getenv('HOME'), '.google', 'picasa', '3.0', 'drive_c', 'Documents and Settings', os.getenv('USER'), 'Local Settings', 'Application Data', 'Google', 'Picasa2Albums')
				
			protocol = PicasaKit().createProtocolFromString(db_path)
			
			m = re.match('\w+://(.*)', db_path)
			db_search = m.group(1)
			
		elif self.getSettingInt('db_location') == 1:
			# local folder
			db_path = "file://" + self.getSetting('db_path_local')
			protocol = PicasaKit().createProtocolFromString(db_path)
			
			m = re.match('\w+://(.*)', db_path)
			db_search = m.group(1)
			
		else:
			# network
			db_path = self.getSetting('db_path_network')
			m = re.match('\w+://(.+?)/', db_path)
			protocol = PicasaKit().createProtocolFromString(db_path)
			protocol.connect(username = self.getSetting('db_path_network_user'), password = self.getSetting('db_path_network_pass'), ip = m.group(1))
			
			m = re.match('\w+://(.*)', db_path)
			db_search = '/' + m.group(1)
		
		
		# search for database files...
		print "search database..."
		location = PicasaKit().createLocation(protocol)
		if location.search_database(db_search) == False:
			print db_search
			xbmcgui.Dialog().ok('Picasa Desktop', 'Database not found at\n[%s]' % db_search)
			return None
		
		# init
		print "use path: " + location.cwd()
		self._picasa = PicasaKit().createDatabase(location)
		
		
		
		# what todo?
		try:
			if self.getParamString('album', None):
				self.listImages( album_id = self.getParamString('album', None) )
				
			else:
				self.listAlbum()
		
		except Exception, e: # python 2.6 as
			xbmcgui.Dialog().ok('Picasa Error', e.__str__())
Esempio n. 5
0
	def __init__(self):
		AddonHelper.__init__(self,'plugin.video.tv-kino')
		self.tv_kino = tv_kino()
		
		# what todo?
		try:
			if self.getParamString('channel_url', None):
				self.playChannel( channel_url = self.getParamString('channel_url', None) )
				
			else:
				self.listChannels()
		
		except Exception, e: # python 2.6 as
			xbmcgui.Dialog().ok('Error', e.__str__())
Esempio n. 6
0
 def __init__(self):
     self.helper = AddonHelper('plugin.image.picasa')
     OAuthHelper.GoogleOAuthorizer.__init__(
         self,
         addon_id='plugin.image.picasa',
         client_id=
         '905208609020-blro1d2vo7qnjo53ku3ajt6tk40i02ip.apps.googleusercontent.com',
         client_secret='9V-BDq0uD4VN8VAfP0U0wIOp',
         auth_scope='https://picasaweb.google.com/data/')
	def __init__(self,show_image=False):
		AddonHelper.__init__(self,'plugin.image.picasa')
		if show_image: return self.showImage()
		self._api = None
		self.pfilter = None
		self.currentUser = self.getSetting('current_user',None)
		self.privacy_levels = ['public','private','protected']

		if self.getSetting('use_login',False):
			self._user = '******'
		else:
			self._user = self.getSetting('username')

		cache_path = self.dataPath('cache')
		if not os.path.exists(cache_path): os.makedirs(cache_path)

		mpp = self.getSettingInt('max_per_page')
		self.max_per_page = [10,20,30,40,50,75,100,200,500,1000][mpp]
		self.isSlideshow = self.getParamString('plugin_slideshow_ss','false') == 'true'
		LOG('isSlideshow: %s' % self.isSlideshow)
Esempio n. 8
0
    def __init__(self, show_image=False):
        AddonHelper.__init__(self, 'plugin.image.picasa')
        if show_image: return self.showImage()
        self._api = None
        self.pfilter = None
        self.currentUser = self.getSetting('current_user', None)
        self.privacy_levels = ['public', 'private', 'protected']

        if self.getSetting('use_login', False):
            self._user = '******'
        else:
            self._user = self.getSetting('username')

        cache_path = self.dataPath('cache')
        if not os.path.exists(cache_path): os.makedirs(cache_path)

        mpp = self.getSettingInt('max_per_page')
        self.max_per_page = [10, 20, 30, 40, 50, 75, 100, 200, 500, 1000][mpp]
        self.isSlideshow = self.getParamString('plugin_slideshow_ss',
                                               'false') == 'true'
        LOG('isSlideshow: %s' % self.isSlideshow)
Esempio n. 9
0
def setViewDefault():
    import xbmc  #@UnresolvedImport
    setting = sys.argv[2]
    view_mode = ""
    for ID in range(50, 59) + range(500, 600):
        try:
            if xbmc.getCondVisibility("Control.IsVisible(%i)" % ID):
                view_mode = repr(ID)
                break
        except:
            pass
    if not view_mode: return
    AddonHelper('plugin.image.picasa').setSetting(setting, view_mode)