Private GIT

Skip to content
Snippets Groups Projects
Commit ce124e5e authored by labrys's avatar labrys
Browse files

Add comments for existing pylint codes

parent cf725bad
Branches
Tags
Loading
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
# Check needed software dependencies to nudge users to fix their setup # Check needed software dependencies to nudge users to fix their setup
# pylint: disable=W0703 # pylint: disable=W0703
# Catching too general exception
from __future__ import with_statement from __future__ import with_statement
...@@ -49,6 +50,7 @@ if sys.version_info < (2, 7): ...@@ -49,6 +50,7 @@ if sys.version_info < (2, 7):
if sys.version_info >= (2, 7, 9): if sys.version_info >= (2, 7, 9):
import ssl import ssl
# pylint: disable=W0212 # pylint: disable=W0212
# Access to a protected member of a client class
ssl._create_default_https_context = ssl._create_unverified_context ssl._create_default_https_context = ssl._create_unverified_context
import locale import locale
...@@ -72,6 +74,7 @@ signal.signal(signal.SIGTERM, sickbeard.sig_handler) ...@@ -72,6 +74,7 @@ signal.signal(signal.SIGTERM, sickbeard.sig_handler)
class SickRage(object): class SickRage(object):
# pylint: disable=R0902 # pylint: disable=R0902
# Too many instance attributes
def __init__(self): def __init__(self):
# system event callback for shutdown/restart # system event callback for shutdown/restart
sickbeard.events = Events(self.shutdown) sickbeard.events = Events(self.shutdown)
...@@ -153,6 +156,8 @@ class SickRage(object): ...@@ -153,6 +156,8 @@ class SickRage(object):
pass pass
# pylint: disable=R0912,R0915 # pylint: disable=R0912,R0915
# Too many branches
# Too many statements
def start(self): def start(self):
# do some preliminary stuff # do some preliminary stuff
sickbeard.MY_FULLNAME = os.path.normpath(os.path.abspath(__file__)) sickbeard.MY_FULLNAME = os.path.normpath(os.path.abspath(__file__))
...@@ -177,11 +182,13 @@ class SickRage(object): ...@@ -177,11 +182,13 @@ class SickRage(object):
if sys.platform == 'win32': if sys.platform == 'win32':
# pylint: disable=E1101 # pylint: disable=E1101
# An object is accessed for a non-existent member.
if sys.getwindowsversion()[0] >= 6 and sys.stdout.encoding == 'cp65001': if sys.getwindowsversion()[0] >= 6 and sys.stdout.encoding == 'cp65001':
sickbeard.SYS_ENCODING = 'UTF-8' sickbeard.SYS_ENCODING = 'UTF-8'
try: try:
# pylint: disable=E1101 # pylint: disable=E1101
# An object is accessed for a non-existent member.
# On non-unicode builds this will raise an AttributeError, if encoding type is not valid it throws a LookupError # On non-unicode builds this will raise an AttributeError, if encoding type is not valid it throws a LookupError
sys.setdefaultencoding(sickbeard.SYS_ENCODING) sys.setdefaultencoding(sickbeard.SYS_ENCODING)
except Exception: except Exception:
...@@ -196,6 +203,7 @@ class SickRage(object): ...@@ -196,6 +203,7 @@ class SickRage(object):
try: try:
# pylint: disable=W0612 # pylint: disable=W0612
# Unused variable
opts, args = getopt.getopt(sys.argv[1:], "hqdp::", opts, args = getopt.getopt(sys.argv[1:], "hqdp::",
['help', 'quiet', 'nolaunch', 'daemon', 'pidfile=', 'port=', ['help', 'quiet', 'nolaunch', 'daemon', 'pidfile=', 'port=',
'datadir=', 'config=', 'noresize']) # @UnusedVariable 'datadir=', 'config=', 'noresize']) # @UnusedVariable
...@@ -405,6 +413,8 @@ class SickRage(object): ...@@ -405,6 +413,8 @@ class SickRage(object):
Fork off as a daemon Fork off as a daemon
""" """
# pylint: disable=E1101,W0212 # pylint: disable=E1101,W0212
# An object is accessed for a non-existent member.
# Access to a protected member of a client class
# Make a non-session-leader child process # Make a non-session-leader child process
try: try:
pid = os.fork() # @UndefinedVariable - only available in UNIX pid = os.fork() # @UndefinedVariable - only available in UNIX
...@@ -547,6 +557,7 @@ class SickRage(object): ...@@ -547,6 +557,7 @@ class SickRage(object):
# system exit # system exit
logger.shutdown() # Make sure the logger has stopped, just in case logger.shutdown() # Make sure the logger has stopped, just in case
# pylint: disable=W0212 # pylint: disable=W0212
# Access to a protected member of a client class
os._exit(0) os._exit(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment