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