Changeset 3734

Show
Ignore:
Timestamp:
08/21/08 20:43:01 (3 months ago)
Author:
andar
Message:

Attempt to upgrade a 0.5.x state file to new format.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.0_RC/ChangeLog

    r3727 r3734  
     1Deluge 0.9.08 - "1.0.0_RC8" (In Development) 
     2 Core: 
     3  * Attempt to automatically upgrade a 0.5.x state file to new format 
     4   
    15Deluge 0.9.07 - "1.0.0_RC7" (18 August 2008) 
    26 Core: 
  • branches/1.0.0_RC/deluge/core/torrentmanager.py

    r3711 r3734  
    4747from deluge.configmanager import ConfigManager 
    4848from deluge.core.torrent import Torrent 
     49import deluge.core.oldstateupgrader 
    4950 
    5051from deluge.log import LOG as log 
     
    5455            torrent_id=None, 
    5556            filename=None, 
    56             total_uploaded=None,  
     57            total_uploaded=0, 
    5758            trackers=None, 
    58             compact=None,  
    59             paused=None,  
     59            compact=False, 
     60            paused=False,  
    6061            save_path=None, 
    61             max_connections=None
    62             max_upload_slots=None
    63             max_upload_speed=None
    64             max_download_speed=None
    65             prioritize_first_last=None, 
     62            max_connections=-1
     63            max_upload_slots=-1
     64            max_upload_speed=-1.0
     65            max_download_speed=-1.0
     66            prioritize_first_last=False, 
    6667            file_priorities=None, 
    6768            queue=None, 
    68             auto_managed=None, 
     69            auto_managed=True, 
    6970            is_finished=False, 
    7071            stop_ratio=2.00, 
    7172            stop_at_ratio=False, 
    72             remove_at_ratio=Tru
     73            remove_at_ratio=Fals
    7374        ): 
    7475        self.torrent_id = torrent_id 
     
    157158         
    158159        self.signals = component.get("SignalManager") 
    159                  
     160 
     161        # Run the old state upgrader before loading state 
     162        deluge.core.oldstateupgrader.OldStateUpgrader() 
     163 
    160164        # Try to load the state from file 
    161165        self.load_state() 
  • trunk/deluge/core/torrentmanager.py

    r3711 r3734  
    4747from deluge.configmanager import ConfigManager 
    4848from deluge.core.torrent import Torrent 
     49import deluge.core.oldstateupgrader 
    4950 
    5051from deluge.log import LOG as log 
    51  
     52                     
    5253class TorrentState: 
    5354    def __init__(self, 
    5455            torrent_id=None, 
    5556            filename=None, 
    56             total_uploaded=None,  
     57            total_uploaded=0, 
    5758            trackers=None, 
    58             compact=None,  
    59             paused=None,  
     59            compact=False, 
     60            paused=False,  
    6061            save_path=None, 
    61             max_connections=None
    62             max_upload_slots=None
    63             max_upload_speed=None
    64             max_download_speed=None
    65             prioritize_first_last=None, 
     62            max_connections=-1
     63            max_upload_slots=-1
     64            max_upload_speed=-1.0
     65            max_download_speed=-1.0
     66            prioritize_first_last=False, 
    6667            file_priorities=None, 
    6768            queue=None, 
    68             auto_managed=None, 
     69            auto_managed=True, 
    6970            is_finished=False, 
    7071            stop_ratio=2.00, 
    7172            stop_at_ratio=False, 
    72             remove_at_ratio=Tru
     73            remove_at_ratio=Fals
    7374        ): 
    7475        self.torrent_id = torrent_id 
     
    157158         
    158159        self.signals = component.get("SignalManager") 
    159                  
     160 
     161        # Run the old state upgrader before loading state 
     162        deluge.core.oldstateupgrader.OldStateUpgrader() 
     163         
    160164        # Try to load the state from file 
    161165        self.load_state()