Now that the plugin's namespace is in use, make the plugins get their own logger instead of using `getPluginLogger()`

This commit is contained in:
Pedro Algarvio 2011-06-03 23:10:43 +01:00
parent 84c5078667
commit 13db148a11
46 changed files with 104 additions and 103 deletions

View File

@ -232,6 +232,8 @@ def setLoggerLevel(level, logger_name=None):
def getPluginLogger(logger_name): def getPluginLogger(logger_name):
if 'deluge.plugins.' in logger_name:
return logging.getLogger(logger_name)
return logging.getLogger("deluge.plugin.%s" % logger_name) return logging.getLogger("deluge.plugin.%s" % logger_name)

View File

@ -40,7 +40,7 @@
from deluge._libtorrent import lt from deluge._libtorrent import lt
import os import os
from deluge.log import getPluginLogger import logging
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
@ -50,7 +50,7 @@ from twisted.internet.task import LoopingCall, deferLater
from twisted.internet import reactor from twisted.internet import reactor
from deluge.event import DelugeEvent from deluge.event import DelugeEvent
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"watchdirs":{}, "watchdirs":{},

View File

@ -38,8 +38,7 @@
# #
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.ui.gtkui import dialogs from deluge.ui.gtkui import dialogs
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
@ -49,7 +48,7 @@ import os
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class IncompatibleOption(Exception): class IncompatibleOption(Exception):
pass pass

View File

@ -37,14 +37,14 @@
# 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.
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):

View File

@ -36,6 +36,7 @@
import os import os
import time import time
import logging
from datetime import datetime, timedelta from datetime import datetime, timedelta
from wsgiref.handlers import format_date_time from wsgiref.handlers import format_date_time
from urlparse import urljoin from urlparse import urljoin
@ -45,7 +46,7 @@ from twisted.internet.task import LoopingCall
from twisted.internet import threads, defer from twisted.internet import threads, defer
from twisted.web import error from twisted.web import error
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
@ -58,7 +59,7 @@ from readers import ReaderParseError
# TODO: check return values for deferred callbacks # TODO: check return values for deferred callbacks
# TODO: review class attributes for redundancy # TODO: review class attributes for redundancy
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"url": "http://deluge-torrent.org/blocklist/nipfilter.dat.gz", "url": "http://deluge-torrent.org/blocklist/nipfilter.dat.gz",

View File

@ -33,17 +33,17 @@
# #
# #
import logging
from datetime import datetime from datetime import datetime
import gtk import gtk
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import common import common
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GtkUI(GtkPluginBase): class GtkUI(GtkPluginBase):
def enable(self): def enable(self):

View File

@ -3,13 +3,12 @@
# Distributed under the same terms as Deluge # Distributed under the same terms as Deluge
## ##
import logging
from exceptions import Exception from exceptions import Exception
from struct import unpack from struct import unpack
import gzip, socket import gzip, socket
from deluge.log import getPluginLogger log = logging.getLogger(__name__)
log = getPluginLogger(__name__)
class PGException(Exception): class PGException(Exception):
pass pass

View File

@ -36,12 +36,12 @@
import os import os
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
#import deluge.ui.webui.lib.newforms_plus as forms #import deluge.ui.webui.lib.newforms_plus as forms

View File

@ -33,13 +33,13 @@
# #
# #
from deluge.log import getPluginLogger import logging
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class Core(CorePluginBase): class Core(CorePluginBase):
def enable(self): def enable(self):

View File

@ -34,14 +34,14 @@
# #
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GtkUI(GtkPluginBase): class GtkUI(GtkPluginBase):
def enable(self): def enable(self):

View File

@ -33,14 +33,14 @@
# #
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):

View File

@ -36,16 +36,16 @@
import os import os
import time import time
import hashlib import hashlib
import logging
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
from deluge.event import DelugeEvent from deluge.event import DelugeEvent
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_CONFIG = { DEFAULT_CONFIG = {
"commands": [] "commands": []

View File

@ -35,15 +35,15 @@
import os import os
import gtk import gtk
import logging
import pkg_resources import pkg_resources
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
EXECUTE_ID = 0 EXECUTE_ID = 0
EXECUTE_EVENT = 1 EXECUTE_EVENT = 1

View File

@ -34,14 +34,14 @@
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):

View File

@ -38,16 +38,16 @@
# #
import os import os
import logging
from twisted.internet.utils import getProcessValue from twisted.internet.utils import getProcessValue
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"extract_path": "", "extract_path": "",

View File

@ -38,8 +38,8 @@
# #
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
@ -47,7 +47,7 @@ import deluge.common
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GtkUI(GtkPluginBase): class GtkUI(GtkPluginBase):
def enable(self): def enable(self):

View File

@ -37,12 +37,12 @@
# #
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):
def enable(self): def enable(self):

View File

@ -37,18 +37,18 @@
# 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 logging
import feedparser # for parsing rss feeds import feedparser # for parsing rss feeds
import threading # for threaded updates import threading # for threaded updates
import re # for regular expressions import re # for regular expressions
from twisted.internet.task import LoopingCall from twisted.internet.task import LoopingCall
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"feeds": {}, "feeds": {},

View File

@ -34,14 +34,14 @@
# but you are not obligated to do so. If you do not wish to do so, delete # but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception # this exception statement from your version. If you delete this exception
import logging
import feedparser # for proccessing feed entries import feedparser # for proccessing feed entries
import os import os
from deluge.log import getPluginLogger
from deluge.ui.client import sclient, aclient from deluge.ui.client import sclient, aclient
from deluge.plugins.webuipluginbase import WebUIPluginBase from deluge.plugins.webuipluginbase import WebUIPluginBase
from deluge import component from deluge import component
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
api = component.get("WebPluginApi") api = component.get("WebPluginApi")
forms = api.forms forms = api.forms

View File

@ -37,18 +37,17 @@
# 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 logging
import os, statvfs import os, statvfs
from datetime import datetime, timedelta from datetime import datetime, timedelta
from twisted.internet import task from twisted.internet import task
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
from deluge.event import DelugeEvent from deluge.event import DelugeEvent
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class LowDiskSpaceEvent(DelugeEvent): class LowDiskSpaceEvent(DelugeEvent):

View File

@ -38,8 +38,8 @@
# #
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
@ -47,7 +47,7 @@ import deluge.common
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GtkUI(GtkPluginBase): class GtkUI(GtkPluginBase):

View File

@ -37,14 +37,14 @@
# 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.
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):

View File

@ -37,7 +37,7 @@ torrent-label core plugin.
adds a status field for tracker. adds a status field for tracker.
""" """
from deluge.log import getPluginLogger import logging
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
@ -47,7 +47,7 @@ from urlparse import urlparse
import traceback import traceback
import re import re
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
RE_VALID = re.compile("[a-z0-9_\-\.]*\Z") RE_VALID = re.compile("[a-z0-9_\-\.]*\Z")

View File

@ -35,8 +35,8 @@
import os import os
import logging
import pkg_resources # access plugin egg import pkg_resources # access plugin egg
from deluge.log import getPluginLogger
from deluge import component # for systray from deluge import component # for systray
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import gtk, gobject import gtk, gobject
@ -46,7 +46,7 @@ import sidebar_menu
import label_config import label_config
import submenu import submenu
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
NO_LABEL = "No Label" NO_LABEL = "No Label"

View File

@ -36,13 +36,13 @@
import gtk import gtk
import gtk.glade import gtk.glade
import os import os
import logging
import pkg_resources # access plugin egg import pkg_resources # access plugin egg
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class LabelConfig(object): class LabelConfig(object):

View File

@ -37,13 +37,13 @@
import gtk import gtk
import gtk.glade import gtk.glade
import logging
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
NO_LABEL = "No Label" NO_LABEL = "No Label"

View File

@ -35,13 +35,13 @@
import os import os
import logging
import pkg_resources # access plugin egg import pkg_resources # access plugin egg
from deluge.log import getPluginLogger
from deluge import component # for systray from deluge import component # for systray
import gtk, gobject import gtk, gobject
from deluge.ui.client import client from deluge.ui.client import client
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
NO_LABEL = "No Label" NO_LABEL = "No Label"

View File

@ -38,14 +38,14 @@
# #
import os import os
import logging
import pkg_resources import pkg_resources
from deluge.common import fspeed from deluge.common import fspeed
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from deluge import component from deluge import component
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
def get_resource(filename): def get_resource(filename):
return pkg_resources.resource_filename("deluge.plugins.label", return pkg_resources.resource_filename("deluge.plugins.label",

View File

@ -37,11 +37,11 @@
# 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 logging
from twisted.internet import defer from twisted.internet import defer
from deluge import component from deluge import component
from deluge.log import getPluginLogger
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
try: try:
from deluge.event import known_events from deluge.event import known_events

View File

@ -38,18 +38,18 @@
# #
import smtplib import smtplib
import logging
from email.utils import formatdate from email.utils import formatdate
from twisted.internet import defer, threads from twisted.internet import defer, threads
from deluge import component from deluge import component
from deluge.event import known_events from deluge.event import known_events
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.configmanager import deluge.configmanager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
from common import CustomNotifications from common import CustomNotifications
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"smtp_enabled": False, "smtp_enabled": False,

View File

@ -37,11 +37,11 @@
# 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 logging
from os.path import basename from os.path import basename
import gtk import gtk
from twisted.internet import defer from twisted.internet import defer
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
@ -51,7 +51,7 @@ import deluge.configmanager
# Relative imports # Relative imports
from common import get_resource, CustomNotifications from common import get_resource, CustomNotifications
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
try: try:
import pygame import pygame

View File

@ -6,12 +6,12 @@
# License: BSD - Please view the LICENSE file for additional information. # License: BSD - Please view the LICENSE file for additional information.
# ============================================================================== # ==============================================================================
import logging
from twisted.internet import task from twisted.internet import task
from deluge import component from deluge import component
from deluge.event import DelugeEvent from deluge.event import DelugeEvent
from deluge.log import getPluginLogger
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class FooEvent(DelugeEvent): class FooEvent(DelugeEvent):
"""foo Event""" """foo Event"""

View File

@ -37,8 +37,8 @@
# 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 logging
from twisted.internet import defer from twisted.internet import defer
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
@ -47,7 +47,7 @@ import deluge.configmanager
# Relative imports # Relative imports
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
# FLASH # FLASH

View File

@ -37,8 +37,7 @@
# #
import time import time
import logging
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
@ -47,7 +46,7 @@ from deluge.event import DelugeEvent
from twisted.internet import reactor from twisted.internet import reactor
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"low_down": -1.0, "low_down": -1.0,

View File

@ -37,8 +37,7 @@
# #
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
@ -46,7 +45,7 @@ import deluge.common
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]

View File

@ -36,14 +36,14 @@
# 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.
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):

View File

@ -44,17 +44,17 @@
# but you are not obligated to do so. If you do not wish to do so, delete # but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception # this exception statement from your version. If you delete this exception
import logging
from twisted.internet.task import LoopingCall from twisted.internet.task import LoopingCall
import time import time
import deluge import deluge
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
from deluge import component from deluge import component
from deluge import configmanager from deluge import configmanager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"test": "NiNiNi", "test": "NiNiNi",

View File

@ -48,7 +48,7 @@ port of old plugin by markybob.
""" """
import time import time
import cairo import cairo
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
black = (0, 0, 0) black = (0, 0, 0)
@ -60,13 +60,13 @@ green = (0, 1.0, 0)
blue = (0, 0, 1.0) blue = (0, 0, 1.0)
orange = (1.0, 0.74, 0) orange = (1.0, 0.74, 0)
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
def default_formatter(value): def default_formatter(value):
return str(value) return str(value)
def change_opacity(color, opactiy): def change_opacity(color, opactiy):
"""A method to assist in changing the opactiy of a color inorder to draw the """A method to assist in changing the opacity of a color in order to draw the
fills. fills.
""" """
color = list(color) color = list(color)

View File

@ -47,19 +47,19 @@
import gtk import gtk
import gobject import gobject
import logging
from gtk.glade import XML from gtk.glade import XML
from twisted.internet import defer from twisted.internet import defer
import graph import graph
from deluge import component from deluge import component
from deluge.log import getPluginLogger
from deluge.common import fspeed from deluge.common import fspeed
from deluge.ui.client import client from deluge.ui.client import client
from deluge.ui.gtkui.torrentdetails import Tab from deluge.ui.gtkui.torrentdetails import Tab
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GraphsTab(Tab): class GraphsTab(Tab):
def __init__(self, glade): def __init__(self, glade):

View File

@ -33,20 +33,20 @@
# #
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):
scripts = [get_resource("stats.js")] scripts = [get_resource("stats.js")]
# The enable and disable methods are not scrictly required on the WebUI # The enable and disable methods are not strictly required on the WebUI
# plugins. They are only here if you need to register images/stylesheets # plugins. They are only here if you need to register images/stylesheets
# with the webserver. # with the webserver.
def enable(self): def enable(self):

View File

@ -37,13 +37,13 @@
# 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.
# #
from deluge.log import getPluginLogger import logging
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
} }

View File

@ -38,8 +38,8 @@
# #
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
@ -47,7 +47,7 @@ import deluge.common
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GtkUI(GtkPluginBase): class GtkUI(GtkPluginBase):
def enable(self): def enable(self):

View File

@ -37,14 +37,14 @@
# 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.
# #
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):

View File

@ -37,13 +37,13 @@
# #
import os import os
import logging
from deluge import common, component, configmanager from deluge import common, component, configmanager
from deluge.log import getPluginLogger
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
from deluge.core.rpcserver import export from deluge.core.rpcserver import export
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
DEFAULT_PREFS = { DEFAULT_PREFS = {
"enabled": False, "enabled": False,

View File

@ -37,8 +37,8 @@
# #
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
@ -46,7 +46,7 @@ import deluge.common
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GtkUI(GtkPluginBase): class GtkUI(GtkPluginBase):
def enable(self): def enable(self):

View File

@ -113,6 +113,7 @@ def create_plugin():
CORE = """ CORE = """
import logging
from deluge.plugins.pluginbase import CorePluginBase from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component import deluge.component as component
import deluge.configmanager import deluge.configmanager
@ -122,6 +123,8 @@ DEFAULT_PREFS = {
"test":"NiNiNi" "test":"NiNiNi"
} }
log = logging.getLogger(__name__)
class Core(CorePluginBase): class Core(CorePluginBase):
def enable(self): def enable(self):
self.config = deluge.configmanager.ConfigManager("%(safe_name)s.conf", DEFAULT_PREFS) self.config = deluge.configmanager.ConfigManager("%(safe_name)s.conf", DEFAULT_PREFS)
@ -216,8 +219,8 @@ def get_resource(filename):
GTKUI = """ GTKUI = """
import gtk import gtk
import logging
from deluge.log import getPluginLogger
from deluge.ui.client import client from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
import deluge.component as component import deluge.component as component
@ -225,7 +228,7 @@ import deluge.common
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class GtkUI(GtkPluginBase): class GtkUI(GtkPluginBase):
def enable(self): def enable(self):
@ -285,14 +288,14 @@ GLADE = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
""" """
WEBUI = """ WEBUI = """
from deluge.log import getPluginLogger import logging
from deluge.ui.client import client from deluge.ui.client import client
from deluge import component from deluge import component
from deluge.plugins.pluginbase import WebPluginBase from deluge.plugins.pluginbase import WebPluginBase
from common import get_resource from common import get_resource
log = getPluginLogger(__name__) log = logging.getLogger(__name__)
class WebUI(WebPluginBase): class WebUI(WebPluginBase):