mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
more cleaning up - removing unneeded white spaces
This commit is contained in:
parent
70b6e40a55
commit
78d8d116cc
5 changed files with 48 additions and 53 deletions
13
src/core.py
13
src/core.py
|
@ -84,15 +84,14 @@ PREF_FUNCTIONS = {
|
||||||
def N_(self):
|
def N_(self):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
STATE_MESSAGES = ( N_("Queued"),
|
STATE_MESSAGES = (N_("Queued"),
|
||||||
N_("Checking"),
|
N_("Checking"),
|
||||||
N_("Connecting"),
|
N_("Connecting"),
|
||||||
N_("Downloading Metadata"),
|
N_("Downloading Metadata"),
|
||||||
N_("Downloading"),
|
N_("Downloading"),
|
||||||
N_("Finished"),
|
N_("Finished"),
|
||||||
N_("Seeding"),
|
N_("Seeding"),
|
||||||
N_("Allocating")
|
N_("Allocating"))
|
||||||
)
|
|
||||||
# Exceptions
|
# Exceptions
|
||||||
|
|
||||||
class DelugeError(Exception):
|
class DelugeError(Exception):
|
||||||
|
@ -499,8 +498,8 @@ class Manager:
|
||||||
deluge_core.resume(unique_ID)
|
deluge_core.resume(unique_ID)
|
||||||
|
|
||||||
elif (not self.get_core_torrent_state(unique_ID, efficient)['is_paused']) and \
|
elif (not self.get_core_torrent_state(unique_ID, efficient)['is_paused']) and \
|
||||||
( (index >= self.get_pref('max_active_torrents') and \
|
((index >= self.get_pref('max_active_torrents') and \
|
||||||
self.get_pref('max_active_torrents') != -1 ) or \
|
self.get_pref('max_active_torrents') != -1) or \
|
||||||
self.is_user_paused(unique_ID)):
|
self.is_user_paused(unique_ID)):
|
||||||
deluge_core.pause(unique_ID)
|
deluge_core.pause(unique_ID)
|
||||||
|
|
||||||
|
@ -652,8 +651,7 @@ class Manager:
|
||||||
# Efficient: use a saved state, if it hasn't expired yet
|
# Efficient: use a saved state, if it hasn't expired yet
|
||||||
def get_core_torrent_state(self, unique_ID, efficiently=True):
|
def get_core_torrent_state(self, unique_ID, efficiently=True):
|
||||||
if unique_ID not in self.saved_core_torrent_states.keys():
|
if unique_ID not in self.saved_core_torrent_states.keys():
|
||||||
self.saved_core_torrent_states[unique_ID] = cached_data(deluge_core.get_torrent_state,
|
self.saved_core_torrent_states[unique_ID] = cached_data(deluge_core.get_torrent_state, unique_ID)
|
||||||
unique_ID)
|
|
||||||
|
|
||||||
return self.saved_core_torrent_states[unique_ID].get(efficiently)
|
return self.saved_core_torrent_states[unique_ID].get(efficiently)
|
||||||
|
|
||||||
|
@ -862,4 +860,3 @@ class Manager:
|
||||||
|
|
||||||
def replace_trackers(self, unique_ID, trackers):
|
def replace_trackers(self, unique_ID, trackers):
|
||||||
return deluge_core.replace_trackers(unique_ID, trackers)
|
return deluge_core.replace_trackers(unique_ID, trackers)
|
||||||
|
|
||||||
|
|
|
@ -331,5 +331,3 @@ def show_directory_chooser_dialog(parent=None, title=None):
|
||||||
result = None
|
result = None
|
||||||
chooser.destroy()
|
chooser.destroy()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,7 @@ DEFAULT_PREFS = {
|
||||||
"window_x_pos" : 0,
|
"window_x_pos" : 0,
|
||||||
"window_y_pos" : 0,
|
"window_y_pos" : 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
class Preferences:
|
class Preferences:
|
||||||
def __init__(self, filename=None, global_defaults=True, defaults=None):
|
def __init__(self, filename=None, global_defaults=True, defaults=None):
|
||||||
self.mapping = {}
|
self.mapping = {}
|
||||||
|
@ -177,4 +178,3 @@ class Preferences:
|
||||||
def printout(self):
|
def printout(self):
|
||||||
for key in self.mapping.keys():
|
for key in self.mapping.keys():
|
||||||
print key, ':', self.mapping[key]
|
print key, ':', self.mapping[key]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue