# Path: tailor/config.py
# def jpath(*args):
# def reload(path):
# 
# Path: tailor/smtp.py
# class SenderThread:
#     def __init__(self, address, filename):
#         self.address = address
#         self.filename = filename
# 
#     def run(self):
#         sender = pkConfig["email"]["sender"]
#         subject = pkConfig["email"]["subject"]
#         auth_file = "/home/mjolnir/git/tailor/secrets"
# 
#         msg = email.MIMEMultipart.MIMEMultipart("mixed")
#         msg["subject"] = subject
#         msg["from"] = sender
#         msg["to"] = self.address
# 
#         body = email.mime.Text.MIMEText("Here's your photo!\n\nThank you!\n\n")
#         msg.attach(body)
# 
#         file_msg = email.mime.base.MIMEBase("image", "jpeg")
#         file_msg.set_payload(open(self.filename).read())
#         email.encoders.encode_base64(file_msg)
#         file_msg.add_header("Content-Disposition", "attachment;filname=photo.jpg")
#         msg.attach(file_msg)
# 
#         with open(auth_file) as fh:
#             auth = pickle.load(fh)
#             auth = auth["smtp"]
# 
#         with open("email.log", "a") as fh:
#             fh.write("{}\t{}\n".format(self.address, self.filename))
# 
#         smtpout = smtplib.SMTP(auth["host"])
#         smtpout.login(auth["username"], auth["password"])
#         smtpout.sendmail(sender, [self.address], msg.as_string())
#         smtpout.quit()


import os.path
from functools import partial
from kivy.config import Config
from kivy.network.urlrequest import UrlRequest
from kivy.properties import *
from kivy.uix.accordion import AccordionItem
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from ..config import pkConfig
from ..smtp import SenderThread
    from PIL import Image
        from kivy.core.window import Window
# -*- coding: utf-8 -*-



MAXIMUM_PRINTS = 3


def double(filename, fn2):

    image = Image.open(filename)
    base = Image.new("RGBA", (1200, 1800))
    areas = ((0, 0), (600, 0))
    for area in areas:
        base.paste(image, area, mask=image)

    new = "double-%s" % fn2

# Path: tailor/config.py
# def jpath(*args):
# def reload(path):
# 
# Path: tailor/smtp.py
# class SenderThread:
#     def __init__(self, address, filename):
#         self.address = address
#         self.filename = filename
# 
#     def run(self):
#         sender = pkConfig["email"]["sender"]
#         subject = pkConfig["email"]["subject"]
#         auth_file = "/home/mjolnir/git/tailor/secrets"
# 
#         msg = email.MIMEMultipart.MIMEMultipart("mixed")
#         msg["subject"] = subject
#         msg["from"] = sender
#         msg["to"] = self.address
# 
#         body = email.mime.Text.MIMEText("Here's your photo!\n\nThank you!\n\n")
#         msg.attach(body)
# 
#         file_msg = email.mime.base.MIMEBase("image", "jpeg")
#         file_msg.set_payload(open(self.filename).read())
#         email.encoders.encode_base64(file_msg)
#         file_msg.add_header("Content-Disposition", "attachment;filname=photo.jpg")
#         msg.attach(file_msg)
# 
#         with open(auth_file) as fh:
#             auth = pickle.load(fh)
#             auth = auth["smtp"]
# 
#         with open("email.log", "a") as fh:
#             fh.write("{}\t{}\n".format(self.address, self.filename))
# 
#         smtpout = smtplib.SMTP(auth["host"])
#         smtpout.login(auth["username"], auth["password"])
#         smtpout.sendmail(sender, [self.address], msg.as_string())
#         smtpout.quit()


# Path: tailor/uix/sharing.py
import os.path
from functools import partial
from kivy.config import Config
from kivy.network.urlrequest import UrlRequest
from kivy.properties import *
from kivy.uix.accordion import AccordionItem
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from ..config import pkConfig
from ..smtp import SenderThread
    from PIL import Image
        from kivy.core.window import Window

# -*- coding: utf-8 -*-



MAXIMUM_PRINTS = 3


def double(filename, fn2):

    image = Image.open(filename)
    base = Image.new("RGBA", (1200, 1800))
    areas = ((0, 0), (600, 0))
    for area in areas:
        base.paste(image, area, mask=image)

    new = "double-%s" % fn2

    new = os.path.join(pkConfig["paths"]["app_root_path"], new)