Larvik commited on
Commit
7099823
·
verified ·
1 Parent(s): f90cfa7

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +13 -3
  2. hpgs.py +15 -10
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
- import sys,os
3
  sys.path.append(os.getcwd())
4
- from hpgs import homepg
5
  from ogtxt import txt
6
  from ogtxtJ2 import txt as j2
7
  from desptxt import desp, nalz
@@ -58,8 +58,18 @@ def tblmaker(ky):
58
  def on_select(data: gr.SelectData):
59
  return tblmaker(data.value['caption'])
60
 
 
 
 
 
 
 
 
 
 
 
61
  statement = gr.HTML(homepg[0])
62
- with gr.Blocks() as demo:
63
  with gr.Row():
64
  for na in nalz:
65
  ymg=na[0]
 
1
  import gradio as gr
2
+ import sys,os,io,contextlib
3
  sys.path.append(os.getcwd())
4
+ from hpgs import homepg, jsinj
5
  from ogtxt import txt
6
  from ogtxtJ2 import txt as j2
7
  from desptxt import desp, nalz
 
58
  def on_select(data: gr.SelectData):
59
  return tblmaker(data.value['caption'])
60
 
61
+ def execute_code(code):
62
+ try:
63
+ exec_globals = {}
64
+ output = io.StringIO()
65
+ with contextlib.redirect_stdout(output):
66
+ exec(code, exec_globals)
67
+ return output.getvalue()
68
+ except Exception as e:
69
+ return str(e)
70
+
71
  statement = gr.HTML(homepg[0])
72
+ with gr.Blocks(js=jsinj[0]) as demo:
73
  with gr.Row():
74
  for na in nalz:
75
  ymg=na[0]
hpgs.py CHANGED
@@ -4,10 +4,24 @@ homepg=[
4
  <u id='0pshow.htm'>html version</u><br>
5
  <a href='https://huggingface.co/spaces/Larvik/FF7ogLookup/raw/main/scriptext.csv'>Extra script text</a><br>
6
  <u id='fontall.htm'>Zangan Kanji Table</u><br>
 
 
 
7
  Tools<br>
8
  <u id='jpegjoin.htm'>jpegjoin js ver.</u><br>
 
 
 
 
 
 
 
 
 
 
9
 
10
- <script>
 
11
  const fmain='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/';
12
 
13
  async function loadipy(durl) {
@@ -36,14 +50,5 @@ function addlnk()
36
  }
37
  }
38
  addlnk();
39
- </script>
40
- ''','''
41
- <h1>Masato Kato</h1>
42
- <img src='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/kato.png'><img src='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/kato_eng.png'>
43
- https://ja.wikipedia.org/wiki/加藤正人_(ゲームクリエイター)<br>
44
- <h3>ファイナルファンタジーVII(1997年)(PlayStation): 企画・演出(ヘルプとしての飛び入り参加)<br>
45
- He has last Debug Room numbering J and K, so he must be a very very late newcomer into the team after "Nomura's *Let's kill the heroine* phone call" incident.</h3><br>
46
- Most of his scripts inherited from Chiba's, including similar joke nicknames in their Debug Rooms, and only these two use "Cait" instead of "Ketcy".
47
- <img src='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/Kato_from_Chiba.png'><br>
48
  '''
49
  ]
 
4
  <u id='0pshow.htm'>html version</u><br>
5
  <a href='https://huggingface.co/spaces/Larvik/FF7ogLookup/raw/main/scriptext.csv'>Extra script text</a><br>
6
  <u id='fontall.htm'>Zangan Kanji Table</u><br>
7
+ Huge .py files<br>
8
+ <a href='https://huggingface.co/spaces/Larvik/FF7ogLookup/raw/main/ogtxt.py'>Intl. Eng<- ->Jp Texts (9mb file, ~1gb browser ram)</a><br>
9
+ <a href='https://huggingface.co/spaces/Larvik/FF7ogLookup/raw/main/ogtxtJ2.py'>PSXJP text (~400mb browser ram)</a><br>
10
  Tools<br>
11
  <u id='jpegjoin.htm'>jpegjoin js ver.</u><br>
12
+ ''','''
13
+ <h1>Masato Kato</h1>
14
+ <img src='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/kato.png'><img src='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/kato_eng.png'>
15
+ https://ja.wikipedia.org/wiki/加藤正人_(ゲームクリエイター)<br>
16
+ <h3>ファイナルファンタジーVII(1997年)(PlayStation): 企画・演出(ヘルプとしての飛び入り参加)<br>
17
+ His Debug Room are numbered J and K, the last of 20 Debug Room numbers, so he must be a very very late newcomer into the team after "Nomura's *Let's kill the heroine* phone call" incident.</h3><br>
18
+ Most of his scripts inherited from Chiba's, including similar joke nicknames in their Debug Rooms, and only these two use "Cait" instead of "Ketcy".
19
+ <img src='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/Kato_from_Chiba.png'><br>
20
+ '''
21
+ ]
22
 
23
+ jsinj=[
24
+ '''
25
  const fmain='https://huggingface.co/spaces/Larvik/FF7ogLookup/resolve/main/';
26
 
27
  async function loadipy(durl) {
 
50
  }
51
  }
52
  addlnk();
 
 
 
 
 
 
 
 
 
53
  '''
54
  ]