mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
example plugin use Preferences class
This commit is contained in:
parent
eac7f38c5e
commit
9dc1c5a3bc
1 changed files with 2 additions and 2 deletions
|
@ -13,10 +13,10 @@ class plugin_Example: # The plugin's class
|
||||||
self.interface = deluge_interface
|
self.interface = deluge_interface
|
||||||
# Classes must be imported as they are needed from within
|
# Classes must be imported as they are needed from within
|
||||||
# the plugin's functions
|
# the plugin's functions
|
||||||
import dcommon, gtk, gtk.glade, dgtk
|
import dcommon, gtk, gtk.glade, dgtk, pref
|
||||||
# Create an options file and try to load existing Values
|
# Create an options file and try to load existing Values
|
||||||
self.config_file = dcommon.CONFIG_DIR + "/example.conf"
|
self.config_file = dcommon.CONFIG_DIR + "/example.conf"
|
||||||
self.config = dcommon.DelugePreferences()
|
self.config = pref.Preferences()
|
||||||
try:
|
try:
|
||||||
self.config.load_from_file(self.config_file)
|
self.config.load_from_file(self.config_file)
|
||||||
except IOError:
|
except IOError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue