mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-28 12:14:49 +00:00
Autopep8 E265
This commit is contained in:
parent
2f68092740
commit
142e96b246
@ -245,7 +245,7 @@ def open_url_in_browser(url):
|
|||||||
import webbrowser
|
import webbrowser
|
||||||
webbrowser.open(url)
|
webbrowser.open(url)
|
||||||
|
|
||||||
## Formatting text functions
|
# Formatting text functions
|
||||||
|
|
||||||
# For performance reasons these fsize units are translated outside the function
|
# For performance reasons these fsize units are translated outside the function
|
||||||
byte_txt = "Bytes"
|
byte_txt = "Bytes"
|
||||||
|
@ -37,8 +37,8 @@ if windows_check():
|
|||||||
'C:\\Program Files (x86)\\7-Zip\\7z.exe',
|
'C:\\Program Files (x86)\\7-Zip\\7z.exe',
|
||||||
]
|
]
|
||||||
switch_7z = "x -y"
|
switch_7z = "x -y"
|
||||||
## Future suport:
|
# Future suport:
|
||||||
## 7-zip cannot extract tar.* with single command.
|
# 7-zip cannot extract tar.* with single command.
|
||||||
# ".tar.gz", ".tgz",
|
# ".tar.gz", ".tgz",
|
||||||
# ".tar.bz2", ".tbz",
|
# ".tar.bz2", ".tbz",
|
||||||
# ".tar.lzma", ".tlz",
|
# ".tar.lzma", ".tlz",
|
||||||
@ -53,9 +53,9 @@ if windows_check():
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
required_cmds = ["unrar", "unzip", "tar", "unxz", "unlzma", "7zr", "bunzip2"]
|
required_cmds = ["unrar", "unzip", "tar", "unxz", "unlzma", "7zr", "bunzip2"]
|
||||||
## Possible future suport:
|
# Possible future suport:
|
||||||
# gunzip: gz (cmd will delete original archive)
|
# gunzip: gz (cmd will delete original archive)
|
||||||
## the following do not extract to dest dir
|
# the following do not extract to dest dir
|
||||||
# ".xz": ["xz", "-d --keep"],
|
# ".xz": ["xz", "-d --keep"],
|
||||||
# ".lzma": ["xz", "-d --format=lzma --keep"],
|
# ".lzma": ["xz", "-d --format=lzma --keep"],
|
||||||
# ".bz2": ["bzip2", "-d --keep"],
|
# ".bz2": ["bzip2", "-d --keep"],
|
||||||
|
@ -314,7 +314,7 @@ class DelugeTransferProtocolTestCase(unittest.TestCase):
|
|||||||
# message_to_send = eval(data)
|
# message_to_send = eval(data)
|
||||||
# self.transfer.transfer_message(message_to_send)
|
# self.transfer.transfer_message(message_to_send)
|
||||||
#
|
#
|
||||||
# # Get the data as sent to the network by DelugeTransferProtocol
|
# Get the data as sent to the network by DelugeTransferProtocol
|
||||||
# compressed_data = self.transfer.get_messages_out_joined()
|
# compressed_data = self.transfer.get_messages_out_joined()
|
||||||
# packet_size = 16000 # Or something smaller...
|
# packet_size = 16000 # Or something smaller...
|
||||||
#
|
#
|
||||||
@ -324,16 +324,16 @@ class DelugeTransferProtocolTestCase(unittest.TestCase):
|
|||||||
# self.assertEquals(len(self.transfer.get_messages_in()), 0)
|
# self.assertEquals(len(self.transfer.get_messages_in()), 0)
|
||||||
# else:
|
# else:
|
||||||
# self.assertEquals(len(self.transfer.get_messages_in()), 1)
|
# self.assertEquals(len(self.transfer.get_messages_in()), 1)
|
||||||
# # Get the data as received by DelugeTransferProtocol
|
# Get the data as received by DelugeTransferProtocol
|
||||||
# transfered_message = self.transfer.get_messages_in().pop(0)
|
# transfered_message = self.transfer.get_messages_in().pop(0)
|
||||||
# # Test that the data structures are equal
|
# Test that the data structures are equal
|
||||||
# #self.assertEquals(transfered_message, message_to_send)
|
# self.assertEquals(transfered_message, message_to_send)
|
||||||
# #self.assertTrue(transfered_message == message_to_send)
|
# self.assertTrue(transfered_message == message_to_send)
|
||||||
#
|
#
|
||||||
# #f.close()
|
# f.close()
|
||||||
# #f = open("rencode.torrentlist", "w")
|
# f = open("rencode.torrentlist", "w")
|
||||||
# #f.write(str(transfered_message))
|
# f.write(str(transfered_message))
|
||||||
# #f.close()
|
# f.close()
|
||||||
|
|
||||||
def receive_parts_helper(self, data, packet_size, receive_func=None):
|
def receive_parts_helper(self, data, packet_size, receive_func=None):
|
||||||
byte_count = len(data)
|
byte_count = len(data)
|
||||||
|
@ -340,7 +340,7 @@ class FilesTab(Tab):
|
|||||||
timestamp = gtk.get_current_event_time()
|
timestamp = gtk.get_current_event_time()
|
||||||
show_file(filepath, timestamp=timestamp)
|
show_file(filepath, timestamp=timestamp)
|
||||||
|
|
||||||
## The following 3 methods create the folder/file view in the treeview
|
# The following 3 methods create the folder/file view in the treeview
|
||||||
def prepare_file_store(self, files):
|
def prepare_file_store(self, files):
|
||||||
split_files = {}
|
split_files = {}
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -111,22 +111,22 @@ class MenuBar(component.Component):
|
|||||||
|
|
||||||
### Connect main window Signals ###
|
### Connect main window Signals ###
|
||||||
component.get("MainWindow").connect_signals({
|
component.get("MainWindow").connect_signals({
|
||||||
## File Menu
|
# File Menu
|
||||||
"on_menuitem_addtorrent_activate": self.on_menuitem_addtorrent_activate,
|
"on_menuitem_addtorrent_activate": self.on_menuitem_addtorrent_activate,
|
||||||
"on_menuitem_createtorrent_activate": self.on_menuitem_createtorrent_activate,
|
"on_menuitem_createtorrent_activate": self.on_menuitem_createtorrent_activate,
|
||||||
"on_menuitem_quitdaemon_activate": self.on_menuitem_quitdaemon_activate,
|
"on_menuitem_quitdaemon_activate": self.on_menuitem_quitdaemon_activate,
|
||||||
"on_menuitem_quit_activate": self.on_menuitem_quit_activate,
|
"on_menuitem_quit_activate": self.on_menuitem_quit_activate,
|
||||||
|
|
||||||
## Edit Menu
|
# Edit Menu
|
||||||
"on_menuitem_preferences_activate": self.on_menuitem_preferences_activate,
|
"on_menuitem_preferences_activate": self.on_menuitem_preferences_activate,
|
||||||
"on_menuitem_connectionmanager_activate": self.on_menuitem_connectionmanager_activate,
|
"on_menuitem_connectionmanager_activate": self.on_menuitem_connectionmanager_activate,
|
||||||
|
|
||||||
## View Menu
|
# View Menu
|
||||||
"on_menuitem_toolbar_toggled": self.on_menuitem_toolbar_toggled,
|
"on_menuitem_toolbar_toggled": self.on_menuitem_toolbar_toggled,
|
||||||
"on_menuitem_sidebar_toggled": self.on_menuitem_sidebar_toggled,
|
"on_menuitem_sidebar_toggled": self.on_menuitem_sidebar_toggled,
|
||||||
"on_menuitem_statusbar_toggled": self.on_menuitem_statusbar_toggled,
|
"on_menuitem_statusbar_toggled": self.on_menuitem_statusbar_toggled,
|
||||||
|
|
||||||
## Help Menu
|
# Help Menu
|
||||||
"on_menuitem_homepage_activate": self.on_menuitem_homepage_activate,
|
"on_menuitem_homepage_activate": self.on_menuitem_homepage_activate,
|
||||||
"on_menuitem_faq_activate": self.on_menuitem_faq_activate,
|
"on_menuitem_faq_activate": self.on_menuitem_faq_activate,
|
||||||
"on_menuitem_community_activate": self.on_menuitem_community_activate,
|
"on_menuitem_community_activate": self.on_menuitem_community_activate,
|
||||||
@ -137,7 +137,7 @@ class MenuBar(component.Component):
|
|||||||
|
|
||||||
# Connect menubar signals
|
# Connect menubar signals
|
||||||
self.builder.connect_signals({
|
self.builder.connect_signals({
|
||||||
## Torrent Menu
|
# Torrent Menu
|
||||||
"on_menuitem_pause_activate": self.on_menuitem_pause_activate,
|
"on_menuitem_pause_activate": self.on_menuitem_pause_activate,
|
||||||
"on_menuitem_resume_activate": self.on_menuitem_resume_activate,
|
"on_menuitem_resume_activate": self.on_menuitem_resume_activate,
|
||||||
"on_menuitem_updatetracker_activate": self.on_menuitem_updatetracker_activate,
|
"on_menuitem_updatetracker_activate": self.on_menuitem_updatetracker_activate,
|
||||||
|
@ -1249,7 +1249,7 @@ class PathChooserComboBox(gtk.HBox, StoredValuesPopup, gobject.GObject):
|
|||||||
self.auto_completer._end_completion(args)
|
self.auto_completer._end_completion(args)
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
## Callbacks and internal functions
|
# Callbacks and internal functions
|
||||||
######################################
|
######################################
|
||||||
|
|
||||||
def on_entry_text_changed(self, entry):
|
def on_entry_text_changed(self, entry):
|
||||||
@ -1349,7 +1349,7 @@ class PathChooserComboBox(gtk.HBox, StoredValuesPopup, gobject.GObject):
|
|||||||
self._stored_values_popping_down = False
|
self._stored_values_popping_down = False
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
## Config dialog
|
# Config dialog
|
||||||
######################################
|
######################################
|
||||||
|
|
||||||
def _on_button_toggle_dropdown_button_press_event(self, widget, event):
|
def _on_button_toggle_dropdown_button_press_event(self, widget, event):
|
||||||
|
@ -72,7 +72,7 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase, component.Compon
|
|||||||
def _on_plugin_disabled_event(self, name):
|
def _on_plugin_disabled_event(self, name):
|
||||||
self.disable_plugin(name)
|
self.disable_plugin(name)
|
||||||
|
|
||||||
## Hook functions
|
# Hook functions
|
||||||
def run_on_show_prefs(self):
|
def run_on_show_prefs(self):
|
||||||
"""This hook is run before the user is shown the preferences dialog.
|
"""This hook is run before the user is shown the preferences dialog.
|
||||||
It is designed so that plugins can update their preference page with
|
It is designed so that plugins can update their preference page with
|
||||||
@ -89,7 +89,7 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase, component.Compon
|
|||||||
for function in self.hooks["on_apply_prefs"]:
|
for function in self.hooks["on_apply_prefs"]:
|
||||||
function()
|
function()
|
||||||
|
|
||||||
## Plugin functions.. will likely move to own class..
|
# Plugin functions.. will likely move to own class..
|
||||||
|
|
||||||
def add_torrentview_text_column(self, *args, **kwargs):
|
def add_torrentview_text_column(self, *args, **kwargs):
|
||||||
return component.get("TorrentView").add_text_column(*args, **kwargs)
|
return component.get("TorrentView").add_text_column(*args, **kwargs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user