From 1c94578b499588939364a90348d83fe8a3963b8f Mon Sep 17 00:00:00 2001 From: Eric Germino <65765604+rikku-02@users.noreply.github.com> Date: Thu, 19 May 2022 20:24:44 +0000 Subject: [PATCH] Revert --- main.py | 6 ++---- multiapp.py | 51 +-------------------------------------------------- 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/main.py b/main.py index 93b2219..079a8ba 100644 --- a/main.py +++ b/main.py @@ -1,10 +1,10 @@ import streamlit as st -from multiapp import MultiApp, MultiApp1 +from multiapp import MultiApp from app import home, create, custom from PIL import Image, ImageDraw, ImageFont, ImageOps app = MultiApp() -app1 = MultiApp1() + st.image('https://owo.whats-th.is/3pBJaga.png') st.title('Text Logo Maker by Rikkuチャン') @@ -13,8 +13,6 @@ app.add_app("Create", create.app) app.add_app("Upload your Custom Design", custom.app) -app1.add_app1("Hehe", home.app) - # The main app app.run() \ No newline at end of file diff --git a/multiapp.py b/multiapp.py index 7b3e1a1..9c4aed9 100644 --- a/multiapp.py +++ b/multiapp.py @@ -45,53 +45,4 @@ def run(self): self.apps, format_func=lambda app: app['title']) - app['function']() - - -class MultiApp1: - """Framework for combining multiple streamlit applications. - Usage: - def foo(): - st.title("Hello Foo") - def bar(): - st.title("Hello Bar") - app = MultiApp() - app.add_app("Foo", foo) - app.add_app("Bar", bar) - app.run() - It is also possible keep each application in a separate file. - import foo - import bar - app = MultiApp() - app.add_app("Foo", foo.app) - app.add_app("Bar", bar.app) - app.run() - """ - - def __init__(self): - self.apps = [] - - def add_app1(self, title, func): - """Adds a new application. - Parameters - ---------- - func: - the python function to render this app. - title: - title of the app. Appears in the dropdown in the sidebar. - """ - self.apps.append({ - "title": title, - "function": func - }) - - def run(self): - # app = st.sidebar.radio( - app1 = st.sidebar.radio( - '[Navigation]', - self.apps, - format_func=lambda app1: app1['title']) - - app1['function']() - - + app['function']() \ No newline at end of file