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.
This commit is contained in:
parent
5594825502
commit
8fb2b45ac8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue