diff options
author | Alon Zakai <kripkensteiner@gmail.com> | 2006-12-02 21:06:12 +0000 |
---|---|---|
committer | Alon Zakai <kripkensteiner@gmail.com> | 2006-12-02 21:06:12 +0000 |
commit | 0a87faee5930ac9b317c5846aa10c9fbfc4e1756 (patch) | |
tree | f0d0a132d3fef8bf19aec25c64d79a9f6ea4dab6 | |
parent | 64d21484ef2f7ef957e724068d38ad8b2a12606f (diff) | |
download | deluge-0a87faee5930ac9b317c5846aa10c9fbfc4e1756.tar.gz deluge-0a87faee5930ac9b317c5846aa10c9fbfc4e1756.tar.bz2 deluge-0a87faee5930ac9b317c5846aa10c9fbfc4e1756.zip |
-rw-r--r-- | library/pytorrent_manager.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/library/pytorrent_manager.py b/library/pytorrent_manager.py index 107afa939..ac7dfd6d1 100644 --- a/library/pytorrent_manager.py +++ b/library/pytorrent_manager.py @@ -42,4 +42,34 @@ # import pytorrent +import os +import pickle +class preferences: + def __init__: + self.max_connections = 60 # Etc. etc. etc. + +class manager: + def __init__(self, pref_filename): + print "Init" + + self.pref_filename = pref_filename + + # Unpickle the preferences + try: + pkl_file = open(pref_filename, 'rb') + self.preferences = pickle.load(pkl_file) + pkl_file.close() + except IOError: + self.preferences = new preferences() + + # Prepare queue + self.queue = [] # queue[x] is the unique_ID of the x-th queue position. Simple. + + # How does the queue get updated? Use biology + + def quit(self): + # Pickle the preferences + output = open(self.pref_filename, 'wb') + pickle.dump(self.preferences, output) + output.close() |