Fix 'debug' command and update some copyright headers
This commit is contained in:
parent
641ac7356c
commit
322495cfd5
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# config.py
|
||||
#
|
||||
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
|
||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
||||
#
|
||||
# Deluge is free software.
|
||||
#
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# connect.py
|
||||
#
|
||||
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
|
||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
||||
#
|
||||
# Deluge is free software.
|
||||
#
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# debug.py
|
||||
#
|
||||
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
|
||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
||||
#
|
||||
# Deluge is free software.
|
||||
#
|
||||
|
@ -25,18 +25,18 @@
|
|||
from deluge.ui.console.main import BaseCommand
|
||||
from deluge.ui.client import client
|
||||
import deluge.ui.console.colors as colors
|
||||
import logging
|
||||
import deluge.log
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Enable and disable debugging"""
|
||||
usage = 'debug [on|off]'
|
||||
def handle(self, state='', **options):
|
||||
if state == 'on':
|
||||
logging.disable(logging.DEBUG)
|
||||
deluge.log.setLoggerLevel("debug")
|
||||
elif state == 'off':
|
||||
logging.disable(logging.ERROR)
|
||||
deluge.log.setLoggerLevel("error")
|
||||
else:
|
||||
print templates.ERROR(self.usage)
|
||||
console.write("{!error!}%s" %s usage)
|
||||
|
||||
def complete(self, text, *args):
|
||||
return [ x for x in ['on', 'off'] if x.startswith(text) ]
|
||||
# def complete(self, text, *args):
|
||||
# return [ x for x in ['on', 'off'] if x.startswith(text) ]
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# quit.py
|
||||
#
|
||||
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
|
||||
# Coptright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
||||
#
|
||||
# Deluge is free software.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue