fixing imports and indents to comply with python style guide - first attempt, this might break things
This commit is contained in:
parent
6fd53ec356
commit
d27137b4e2
|
@ -0,0 +1 @@
|
|||
|
|
@ -28,8 +28,12 @@
|
|||
# this exception statement from your version. If you delete this exception
|
||||
# statement from all source files in the program, then also delete it here.
|
||||
|
||||
import sys, os, os.path, webbrowser
|
||||
import xdg, xdg.BaseDirectory
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
import webbrowser
|
||||
import xdg
|
||||
import xdg.BaseDirectory
|
||||
|
||||
import gettext
|
||||
|
||||
|
|
13
src/core.py
13
src/core.py
|
@ -1,3 +1,4 @@
|
|||
# core.py
|
||||
#
|
||||
# Copyright (C) 2006 Alon Zakai ('Kripken') <kripkensteiner@gmail.com>
|
||||
#
|
||||
|
@ -47,8 +48,14 @@
|
|||
# 3. supp_torrent_state - supplementary torrent data, from Deluge
|
||||
|
||||
import deluge_core
|
||||
import os, os.path, shutil, statvfs
|
||||
import pickle, time, gettext, pref
|
||||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
import statvfs
|
||||
import pickle
|
||||
import time
|
||||
import gettext
|
||||
import pref
|
||||
|
||||
# Constants
|
||||
|
||||
|
@ -797,12 +804,10 @@ class Manager:
|
|||
def calc_ratio(self, unique_ID, torrent_state):
|
||||
up = float((torrent_state['total_payload_upload'] / 1024) + (self.unique_IDs[unique_ID].uploaded_memory / 1024))
|
||||
down = float(torrent_state["total_done"] / 1024)
|
||||
|
||||
try:
|
||||
ret = float(up/down)
|
||||
except:
|
||||
ret = 0
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
|
|
|
@ -28,9 +28,13 @@
|
|||
# this exception statement from your version. If you delete this exception
|
||||
# statement from all source files in the program, then also delete it here.
|
||||
|
||||
import common, dgtk, pref
|
||||
import gtk, gtk.glade
|
||||
import os, os.path
|
||||
import common
|
||||
import dgtk
|
||||
import pref
|
||||
import gtk
|
||||
import gtk.glade
|
||||
import os
|
||||
import os.path
|
||||
|
||||
PREFS_FILENAME = "prefs.state"
|
||||
|
||||
|
|
|
@ -30,15 +30,27 @@
|
|||
# this exception statement from your version. If you delete this exception
|
||||
# statement from all source files in the program, then also delete it here.
|
||||
|
||||
import sys, os, os.path, urllib
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
import urllib
|
||||
from itertools import izip
|
||||
import core, common, dgtk, ipc_manager, dialogs
|
||||
import plugins, pref
|
||||
import core
|
||||
import common
|
||||
import dgtk
|
||||
import ipc_manager
|
||||
import dialogs
|
||||
import plugins
|
||||
import pref
|
||||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk, gtk.glade, gobject
|
||||
import xdg, xdg.BaseDirectory
|
||||
import gettext, locale
|
||||
import gtk
|
||||
import gtk.glade
|
||||
import gobject
|
||||
import xdg
|
||||
import xdg.BaseDirectory
|
||||
import gettext
|
||||
import locale
|
||||
|
||||
class DelugeGTK:
|
||||
def __init__(self):
|
||||
|
@ -1075,16 +1087,12 @@ class DelugeGTK:
|
|||
|
||||
|
||||
elif tab == 2: #file tab
|
||||
|
||||
unique_id = self.get_selected_torrent()
|
||||
|
||||
new_file_info = self.manager.get_torrent_file_info(unique_id)
|
||||
|
||||
for file in new_file_info:
|
||||
iter = self.file_get_iter_from_name(file['path'])
|
||||
if (iter != None) and (round(self.file_store.get_value(iter, 4),2) != round(file['progress'],2)):
|
||||
self.file_store.set_value(iter, 4, round(file['progress'],2))
|
||||
|
||||
return True
|
||||
|
||||
else:
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
# 0.80.0. I finally found a solution by reading the source code from the
|
||||
# Listen project.
|
||||
try:
|
||||
import dbus, dbus.service
|
||||
import dbus
|
||||
import dbus.service
|
||||
dbus_version = getattr(dbus, 'version', (0,0,0))
|
||||
if dbus_version >= (0,41,0) and dbus_version < (0,80,0):
|
||||
dbus.SessionBus()
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
# this exception statement from your version. If you delete this exception
|
||||
# statement from all source files in the program, then also delete it here.
|
||||
|
||||
import os, sys, imp
|
||||
import os
|
||||
import sys
|
||||
import imp
|
||||
|
||||
class PluginManager:
|
||||
def __init__(self, deluge_core, deluge_interface):
|
||||
|
|
Loading…
Reference in New Issue