fixing pylint suggestions

This commit is contained in:
2013-07-21 22:35:53 +10:00
parent 5ca6c3861e
commit 1297a07e37
5 changed files with 16 additions and 13 deletions

View File

@@ -12,6 +12,10 @@ from email.mime.text import MIMEText
def sendemail(settingsfilename, subject, body): def sendemail(settingsfilename, subject, body):
"""
Send an email using the settings defined in settingsfilename
"""
settings = EmailSettings(settingsfilename) settings = EmailSettings(settingsfilename)
msg = MIMEText(body, "plain") msg = MIMEText(body, "plain")
@@ -19,10 +23,10 @@ def sendemail(settingsfilename, subject, body):
msg["From"] = settings.getfromaddress() msg["From"] = settings.getfromaddress()
msg["To"] = settings.gettoaddress() msg["To"] = settings.gettoaddress()
s = smtplib.SMTP(settings.getsmtpserver()) smtp = smtplib.SMTP(settings.getsmtpserver())
s.ehlo() smtp.ehlo()
s.starttls() smtp.starttls()
s.login(settings.getsmtpuser(), settings.getsmtppassword()) smtp.login(settings.getsmtpuser(), settings.getsmtppassword())
s.sendmail(settings.getfromaddress(), [settings.gettoaddress()], smtp.sendmail(settings.getfromaddress(), [settings.gettoaddress()],
msg.as_string()) msg.as_string())
s.quit() smtp.quit()

View File

@@ -112,7 +112,8 @@ class FileManager:
#will reach here if there were less than numberofFiles found #will reach here if there were less than numberofFiles found
return showstoprocess return showstoprocess
def checkduplicates(self, filename): @staticmethod
def checkduplicates(filename):
""" """
Check to see if there are any other video files existing for the Check to see if there are any other video files existing for the
episode episode
@@ -121,7 +122,7 @@ class FileManager:
dirname = os.path.dirname(filename) dirname = os.path.dirname(filename)
filename = os.path.basename(filename)[:6] filename = os.path.basename(filename)[:6]
for dirpath, dirnames, filenames in os.walk(dirname): for filenames in os.walk(dirname)[2]:
for show in filenames: for show in filenames:
extension = os.path.splitext(show)[1] extension = os.path.splitext(show)[1]
if (extension in [".avi", ".mpg", ".mpeg", "mp4"] and if (extension in [".avi", ".mpg", ".mpeg", "mp4"] and

View File

@@ -227,8 +227,6 @@ class Settings:
else: else:
return show["SickbeardPrefix"] return show["SickbeardPrefix"]
# TODO check if this is actually doing anything. it seems like it
# just returns what is input
def getshow(self, showname): def getshow(self, showname):
""" """
Get the name of the show, showname. Get the name of the show, showname.

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
pep8 TVEncoder.py libfilemanager.py libhandbrake.py libmythtv.py libsettings.py libsickbeard.py libtvdatasource.py libtvshow.py pep8 libemail.py TVEncoder.py libfilemanager.py libhandbrake.py libmythtv.py libsettings.py libsickbeard.py libtvdatasource.py libtvshow.py

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
pylint TVEncoder.py libfilemanager.py libhandbrake.py libmythtv.py libsettings.py libsickbeard.py libtvdatasource.py libtvshow.py pylint TVEncoder.py libfilemanager.py libhandbrake.py libmythtv.py libsettings.py libsickbeard.py libtvdatasource.py libtvshow.py libemail.py