# Path: edx_data_research/tasks/tasks.py
# class Tasks(object):
#     __metaclass__ = abc.ABCMeta
#     
#     @abc.abstractmethod
#     def do(self):
#         """Run a task"""
#         pass


import os
import smtplib
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from edx_data_research.tasks.tasks import Tasks
        self.attachments = args.attachments

    def do(self):
        message = self.init_email()
        if self.body:
            message.attach(self.body)
        for attachment in self.attachments:
            message.attach(self.upload_attachment(attachment))
        self.send_email(message)

    def init_email(self):
        message = MIMEMultipart()
        message['From'] = self.from_name or self.from_address
        message['To'] = ','.join(self.to_address)
        message['Subject'] = self.subject
        return message

    @staticmethod
    def file_name(file_path):
        _, tail = os.path.split(file_path)
        return tail

    def upload_attachment(self, attachment):
        name = Email.file_name(attachment)
        with open(attachment, 'rb') as fp:
            file_attachment = MIMEText(fp.read())
            file_attachment.add_header('Content-Disposition', 'attachment',
                                        filename=name)
        return file_attachment


# Path: edx_data_research/tasks/tasks.py
# class Tasks(object):
#     __metaclass__ = abc.ABCMeta
#     
#     @abc.abstractmethod
#     def do(self):
#         """Run a task"""
#         pass


# Path: edx_data_research/tasks/tasks_email.py
import os
import smtplib
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from edx_data_research.tasks.tasks import Tasks

        self.attachments = args.attachments

    def do(self):
        message = self.init_email()
        if self.body:
            message.attach(self.body)
        for attachment in self.attachments:
            message.attach(self.upload_attachment(attachment))
        self.send_email(message)

    def init_email(self):
        message = MIMEMultipart()
        message['From'] = self.from_name or self.from_address
        message['To'] = ','.join(self.to_address)
        message['Subject'] = self.subject
        return message

    @staticmethod
    def file_name(file_path):
        _, tail = os.path.split(file_path)
        return tail

    def upload_attachment(self, attachment):
        name = Email.file_name(attachment)
        with open(attachment, 'rb') as fp:
            file_attachment = MIMEText(fp.read())
            file_attachment.add_header('Content-Disposition', 'attachment',
                                        filename=name)
        return file_attachment


    def compose_email(self):