This is kinda hard for me to explain.
I'm working on a project that automatically generates an email signature. I made a pre-built "test" version to try out myself.
The point of it is that you put in the email address and it generates an email signature after you hit the "Generate Signature" button.
The issue is that when I click the "Generate Signature" button after putting in the email address, it does nothing. What I want it to do is go to the next screen with the email signature.
Here is what I have in the main.py file:
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.app import App
from kivy.uix.label import Label
from signature import *
class EmailSignatureGenerator(App):
"""Main app class"""
def build(self):
self.title = "Email Signature Generator"
return EmailScreen()
class SignatureScreen(GridLayout):
"""This is the screen that shows the signature. This also copies the signature to
the clipboard."""
def __init__(self, signature, **kwargs):
super().__init__(**kwargs)
self.cols = 1
Window.size = (500, 300)
self.add_widget(Label(text=str(signature)))
self.add_widget(Label(text="Your signature has been copied to your clipboard"))
self.add_widget(Label(text="Just go to Settings > Mail > Signature and paste!"))
class EmailScreen(GridLayout):
"""First screen that the user will see. It asks for the email address. The email
address is used to search for the user """
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cols = 1
Window.size = (500, 300)
self.add_widget(Label(text="Email Address"))
self.email = TextInput(multiline=False)
self.email.focus = True
self.add_widget(self.email)
self.generate_signature = Button(text="Generate Signature")
self.generate_signature.bind(on_press=SignatureScreen)
self.add_widget(self.generate_signature)
if __name__ == "__main__":
EmailSignatureGenerator().run()
And here is the signature.py
from main import EmailScreen
class User:
"""External or internal employee"""
def __init__(self, full_name, job_title, phone, email):
self.full_name = full_name
self.job_title = job_title
self.phone = phone
self.email = email
class Office:
"""Office location of the corporate user"""
def __init__(self, name, address):
self.name = name
self.address = address
user = User("Matt Jarrett", "Deskside Technician", "(248)XXX-XXXX", EmailScreen().email)
office = Office("Main Corporate Office", "123 Main St. New York, NY 10000")
signature = f"{user.full_name} | {user.job_title} | {office.name}" \
f"{office.address} | {user.phone} | {user.email}"
Thank you, any advice is appreciated.
