more cleaning up - removing unneeded white spaces
This commit is contained in:
parent
70b6e40a55
commit
78d8d116cc
13
src/core.py
13
src/core.py
|
@ -84,15 +84,14 @@ PREF_FUNCTIONS = {
|
|||
def N_(self):
|
||||
return self
|
||||
|
||||
STATE_MESSAGES = ( N_("Queued"),
|
||||
STATE_MESSAGES = (N_("Queued"),
|
||||
N_("Checking"),
|
||||
N_("Connecting"),
|
||||
N_("Downloading Metadata"),
|
||||
N_("Downloading"),
|
||||
N_("Finished"),
|
||||
N_("Seeding"),
|
||||
N_("Allocating")
|
||||
)
|
||||
N_("Allocating"))
|
||||
# Exceptions
|
||||
|
||||
class DelugeError(Exception):
|
||||
|
@ -499,8 +498,8 @@ class Manager:
|
|||
deluge_core.resume(unique_ID)
|
||||
|
||||
elif (not self.get_core_torrent_state(unique_ID, efficient)['is_paused']) and \
|
||||
( (index >= self.get_pref('max_active_torrents') and \
|
||||
self.get_pref('max_active_torrents') != -1 ) or \
|
||||
((index >= self.get_pref('max_active_torrents') and \
|
||||
self.get_pref('max_active_torrents') != -1) or \
|
||||
self.is_user_paused(unique_ID)):
|
||||
deluge_core.pause(unique_ID)
|
||||
|
||||
|
@ -652,8 +651,7 @@ class Manager:
|
|||
# Efficient: use a saved state, if it hasn't expired yet
|
||||
def get_core_torrent_state(self, unique_ID, efficiently=True):
|
||||
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,
|
||||
unique_ID)
|
||||
self.saved_core_torrent_states[unique_ID] = cached_data(deluge_core.get_torrent_state, unique_ID)
|
||||
|
||||
return self.saved_core_torrent_states[unique_ID].get(efficiently)
|
||||
|
||||
|
@ -862,4 +860,3 @@ class Manager:
|
|||
|
||||
def replace_trackers(self, 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
|
||||
chooser.destroy()
|
||||
return result
|
||||
|
||||
|
||||
|
|
|
@ -99,6 +99,7 @@ DEFAULT_PREFS = {
|
|||
"window_x_pos" : 0,
|
||||
"window_y_pos" : 0,
|
||||
}
|
||||
|
||||
class Preferences:
|
||||
def __init__(self, filename=None, global_defaults=True, defaults=None):
|
||||
self.mapping = {}
|
||||
|
@ -177,4 +178,3 @@ class Preferences:
|
|||
def printout(self):
|
||||
for key in self.mapping.keys():
|
||||
print key, ':', self.mapping[key]
|
||||
|
||||
|
|
Loading…
Reference in New Issue