Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -566,7 +566,7 @@ def view_outputs():
|
|
566 |
|
567 |
def save(title,content):
|
568 |
with open("judul.txt", "w") as file:
|
569 |
-
file.write(
|
570 |
|
571 |
with open("kontent.txt", "w") as file:
|
572 |
file.write(content)
|
@@ -586,6 +586,9 @@ def save(title,content):
|
|
586 |
repo_type="space",
|
587 |
token="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",
|
588 |
)
|
|
|
|
|
|
|
589 |
|
590 |
def view():
|
591 |
with open('judul.txt', 'r') as file:
|
@@ -633,7 +636,8 @@ with gr.Blocks(theme = "soft", title="Wordpress Article Generator") as article_g
|
|
633 |
content = gr.Textbox("", label="Konten", interactive=True)
|
634 |
view_output.click(fn=view_outputs, outputs = [title,img,content])
|
635 |
save_button= gr.Button("Save Changes")
|
636 |
-
|
|
|
637 |
with gr.Column():
|
638 |
endpoint= gr.Textbox(placeholder="Masukkan Endpoint Wordpress", label="Endpoint Wordpress")
|
639 |
endpoint_media= gr.Textbox(placeholder="Masukkan Endpoint Media Wordpress", label="Endpoint Media")
|
|
|
566 |
|
567 |
def save(title,content):
|
568 |
with open("judul.txt", "w") as file:
|
569 |
+
file.write(title)
|
570 |
|
571 |
with open("kontent.txt", "w") as file:
|
572 |
file.write(content)
|
|
|
586 |
repo_type="space",
|
587 |
token="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",
|
588 |
)
|
589 |
+
if file:
|
590 |
+
status = "Perubahan Berhasil Disimpan"
|
591 |
+
return status
|
592 |
|
593 |
def view():
|
594 |
with open('judul.txt', 'r') as file:
|
|
|
636 |
content = gr.Textbox("", label="Konten", interactive=True)
|
637 |
view_output.click(fn=view_outputs, outputs = [title,img,content])
|
638 |
save_button= gr.Button("Save Changes")
|
639 |
+
status = gr.HTML("")
|
640 |
+
save_button.click(fn=save, inputs =[title,content], outputs = status)
|
641 |
with gr.Column():
|
642 |
endpoint= gr.Textbox(placeholder="Masukkan Endpoint Wordpress", label="Endpoint Wordpress")
|
643 |
endpoint_media= gr.Textbox(placeholder="Masukkan Endpoint Media Wordpress", label="Endpoint Media")
|