def delete_tokens(): """Delete all cached tokens""" # Remove old tokens # FIXME: Deprecate and simplify this part in a future version _, files = listdir(addon_profile()) token_files = [item for item in files if item.endswith('.tkn')] # Empty userdata/tokens/ directory if exists(get_tokens_path()): _, files = listdir(get_tokens_path()) token_files += ['tokens/' + item for item in files] if token_files: for item in token_files: delete(addon_profile() + item) notification(message=localize(30985))
def __init__(self): """Initialize searchtes, relies on XBMC vfs""" self._favorites = Favorites() self._resumepoints = ResumePoints() self._search_history = addon_profile() + 'search_history.json'
def _create_settings_dir(): """Create settings directory""" settingsdir = addon_profile() if not exists(settingsdir): mkdir(settingsdir)