def get_user_storage(self): if self.user_storage: return self.user_storage filename = os.path.join(cache.base_path, 'localuserdata-%s.local' % str(api.user_id)) self.user_storage = _Storage(filename) return self.user_storage
def get_playlist_storage(self): if self.playlist_storage is not None: return self.playlist_storage if api.user_id is None or self.nid is None: warn(self, 'Missing user_id: {user_id} or nid: {nid}', user_id=api.user_id, nid=self.nid) return None self.playlist_storage = _Storage(self._get_playlist_storage_filename()) return self.playlist_storage