Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,15 @@ import gradio as gr
|
|
| 2 |
import fanl_yp
|
| 3 |
import zlib
|
| 4 |
|
| 5 |
-
def greet(
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
demo = gr.Interface(fn=greet, inputs=["file"], outputs=["
|
| 9 |
demo.launch()
|
|
|
|
| 2 |
import fanl_yp
|
| 3 |
import zlib
|
| 4 |
|
| 5 |
+
def greet(gameFilePath: str):
|
| 6 |
+
gameFile = open(gameFilePath, "br")
|
| 7 |
+
data = zlib.decompress(gameFile.read())
|
| 8 |
+
gameFile.close()
|
| 9 |
+
game = fanl_yp.decode.decode(data)
|
| 10 |
+
// манипуляции с сохранением...
|
| 11 |
+
output = fanl_yp.encode.encode(game, gameFilePath + "_fixed")
|
| 12 |
+
output.flush()
|
| 13 |
+
return gameFilePath + "_fixed"
|
| 14 |
|
| 15 |
+
demo = gr.Interface(fn=greet, inputs=["file"], outputs=["file"])
|
| 16 |
demo.launch()
|