From 8fb2b45ac8e2fdb5eb2aa989d9726241a58b2f76 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sun, 14 Nov 2010 17:29:31 -0500 Subject: [PATCH] Add prefs2 variable / remove vars The prefs2 structure is where I will store my new tree-based preferences. I'll use this for now until everything gets moved over. I also remove the vars variable since nothing uses it. --- libsaria/__init__.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libsaria/__init__.py b/libsaria/__init__.py index 694cdb1f..f7a5da2c 100644 --- a/libsaria/__init__.py +++ b/libsaria/__init__.py @@ -12,13 +12,13 @@ if __dev__ == True: import event import path +from trees import Tree, PersPrefTree from map import Map from cache import Cache -# Variables are not saved across sessions, but preferences are # The cache is also saved across sessions -vars = None prefs = None +prefs2 = None cache = Cache() plugin = None @@ -28,13 +28,13 @@ lastfm = None # Initialize helpful variables def init(): - global vars global prefs + global prefs2 global audio global lastfm - vars = Map() prefs = Map("preferences") + prefs2 = PersPrefTree("preferences") import audio import lastfm @@ -47,11 +47,6 @@ def init_pref(key, value): if prefs.get(key, None) == None: prefs[key] = value -def init_var(key, value): - global vars - if vars.get(key, None) == None: - vars[key] = value - def startup(): global plugin