fixing pylint suggestions
This commit is contained in:
16
libemail.py
16
libemail.py
@@ -12,6 +12,10 @@ from email.mime.text import MIMEText
|
||||
|
||||
|
||||
def sendemail(settingsfilename, subject, body):
|
||||
"""
|
||||
Send an email using the settings defined in settingsfilename
|
||||
"""
|
||||
|
||||
settings = EmailSettings(settingsfilename)
|
||||
|
||||
msg = MIMEText(body, "plain")
|
||||
@@ -19,10 +23,10 @@ def sendemail(settingsfilename, subject, body):
|
||||
msg["From"] = settings.getfromaddress()
|
||||
msg["To"] = settings.gettoaddress()
|
||||
|
||||
s = smtplib.SMTP(settings.getsmtpserver())
|
||||
s.ehlo()
|
||||
s.starttls()
|
||||
s.login(settings.getsmtpuser(), settings.getsmtppassword())
|
||||
s.sendmail(settings.getfromaddress(), [settings.gettoaddress()],
|
||||
smtp = smtplib.SMTP(settings.getsmtpserver())
|
||||
smtp.ehlo()
|
||||
smtp.starttls()
|
||||
smtp.login(settings.getsmtpuser(), settings.getsmtppassword())
|
||||
smtp.sendmail(settings.getfromaddress(), [settings.gettoaddress()],
|
||||
msg.as_string())
|
||||
s.quit()
|
||||
smtp.quit()
|
||||
|
||||
@@ -112,7 +112,8 @@ class FileManager:
|
||||
#will reach here if there were less than numberofFiles found
|
||||
return showstoprocess
|
||||
|
||||
def checkduplicates(self, filename):
|
||||
@staticmethod
|
||||
def checkduplicates(filename):
|
||||
"""
|
||||
Check to see if there are any other video files existing for the
|
||||
episode
|
||||
@@ -121,7 +122,7 @@ class FileManager:
|
||||
dirname = os.path.dirname(filename)
|
||||
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:
|
||||
extension = os.path.splitext(show)[1]
|
||||
if (extension in [".avi", ".mpg", ".mpeg", "mp4"] and
|
||||
|
||||
@@ -227,8 +227,6 @@ class Settings:
|
||||
else:
|
||||
return show["SickbeardPrefix"]
|
||||
|
||||
# TODO check if this is actually doing anything. it seems like it
|
||||
# just returns what is input
|
||||
def getshow(self, showname):
|
||||
"""
|
||||
Get the name of the show, showname.
|
||||
|
||||
2
pep8.sh
2
pep8.sh
@@ -1,3 +1,3 @@
|
||||
#!/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
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/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
|
||||
|
||||
Reference in New Issue
Block a user