Exemplo n.º 1
0
def admin_input(x, y):
    import admin
    check = admin.admincall(x, y)
    if check == "login successful!!!!..":
        print(check)
        eel.show("admin-manage.html")
    else:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
        <head></head>
        <body><br/><center><H1 style="color:Red">{check}</H1></center</body>
        </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
def add_popup(input_words):
    sentences = sent_tokenize(input_words)

    output_words = ""
    for ru in sentences:
        url = "https://script.google.com/macros/s/AKfycbyMd"\
              "s6HiWhtHjnK0FiAYlhcKSa4sns6UIt-iZH1jS9-rCbyK"\
              "p07/exec?text=" + ru + "&source=ru&target=ja"

        ja = requests.get(url).text
        output_words += f'<span title="{ja}">{ru}</span> '

    output_words = output_words.rstrip()

    eel.show(output_words)
Exemplo n.º 3
0
def forgot_input(userlogin, otp, password):
    import forgot_pass
    check = forgot_pass.forcall(userlogin, otp, password, gotp)
    if check == "update successfully":
        print(check)
        eel.show("user-login.html")
    else:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
        <head></head>
        <body><br/><center><H1 style="color:Red">{check}</H1></center</body>
        </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
Exemplo n.º 4
0
def ur_input(w, x, y, z):
    import user_registration
    urchecck = user_registration.urcall(w, x, y, z)
    if urchecck == True:
        print("Register successful!!!!..")
        eel.show("user-login.html")
    else:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
        <head></head>
        <body><br/><center><H1 style="color:Red">{urchecck}</H1></center</body>
        </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
Exemplo n.º 5
0
def user_input(userlogin, password):
    print(userlogin, password)
    import user_login
    check = user_login.usercall(userlogin, password)
    if check == "login successful!!!!..":
        print(check)
        eel.show("adding-blog.html")
    else:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
        <head></head>
        <body><br/><center><H1 style="color:Red">{check}</H1></center</body>
        </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
Exemplo n.º 6
0
def deleteuser(user, title):
    import view_delete
    userdelete = view_delete.Deleting_user(user, title).deleteuser()
    print(userdelete)
    if userdelete == True:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
                                <head></head>
                                <body><br/><center><H1 style="color:Green">Successfully, Deleted Blog</H1></center</body>
                                </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
    else:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
                                <head></head>
                                <body><br/><center><H1 style="color:Red">blog not delect there may user or title not exists</H1></center</body>
                                </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
Exemplo n.º 7
0
def edit_update(title, add_blog):
    #print(title,add_blog)
    adduser = lister[-1]
    import adding_blog
    check = adding_blog.EditBlog().editerBlog(adduser, title.lower(), add_blog)
    if check == True:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
                        <head></head>
                        <body><br/><center><H1 style="color:Green">blog updated, Successfully</H1></center</body>
                        </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
    else:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
                        <head></head>
                        <body><br/><center><H1 style="color:Red">blog not updated, title can't be updated and single and double quotes are not allowed</H1></center</body>
                        </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
Exemplo n.º 8
0
def addblog_input(title, add_blog):
    adduser = lister[-1]
    import adding_blog
    check = adding_blog.addblogcall(adduser, title, add_blog)
    print(check)
    if check == True:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
                <head></head>
                <body><br/><center><H1 style="color:Green">blog added, Successfully</H1></center</body>
                </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
    else:
        f = open('web/prompt.html', 'w')
        message = f"""<html>
        <head></head>
        <body><br/><center><H1 style="color:Red">blog not added,title already exists or 'single quotes and double quotes are not allowed'</H1></center</body>
        </html>"""
        f.write(message)
        f.close()
        eel.show("prompt.html")
Exemplo n.º 9
0
def is_user_logged_in():
    if user is None:
        eel.show('login.html')