Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,14 @@ api=HfApi(token="")
|
|
| 15 |
filename="urls"
|
| 16 |
filename2="pages"
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
def init(filename=filename,save_data=save_data):
|
| 19 |
#if filename==None:
|
| 20 |
# filename=filename
|
|
@@ -27,8 +35,9 @@ def init(filename=filename,save_data=save_data):
|
|
| 27 |
return lod
|
| 28 |
|
| 29 |
|
| 30 |
-
def sort_doc(in_list,file_state,steps_in=0,control=None):
|
| 31 |
-
|
|
|
|
| 32 |
control_json={'control':'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','char':'','leng':62}
|
| 33 |
text=str(in_list)
|
| 34 |
key_cnt=len(in_list)
|
|
@@ -415,11 +424,13 @@ with gr.Blocks() as app:
|
|
| 415 |
with gr.Column(scale=3):
|
| 416 |
with gr.Row():
|
| 417 |
inp=gr.Textbox(label="URL")
|
| 418 |
-
level=gr.Slider(minimum=1,maximum=
|
| 419 |
btn=gr.Button()
|
|
|
|
| 420 |
key_json=gr.JSON()
|
| 421 |
outp=gr.JSON()
|
| 422 |
with gr.Column(scale=1):
|
| 423 |
outmap=gr.JSON()
|
| 424 |
-
|
|
|
|
| 425 |
app.launch()
|
|
|
|
| 15 |
filename="urls"
|
| 16 |
filename2="pages"
|
| 17 |
|
| 18 |
+
|
| 19 |
+
def mega():
|
| 20 |
+
with open("./seed.txt") as f:
|
| 21 |
+
this = f.readlines()
|
| 22 |
+
f.close()
|
| 23 |
+
for ea in this:
|
| 24 |
+
print(ea)
|
| 25 |
+
|
| 26 |
def init(filename=filename,save_data=save_data):
|
| 27 |
#if filename==None:
|
| 28 |
# filename=filename
|
|
|
|
| 35 |
return lod
|
| 36 |
|
| 37 |
|
| 38 |
+
def sort_doc(in_list,file_state=None,steps_in=0,control=None):
|
| 39 |
+
|
| 40 |
+
lod=init()
|
| 41 |
control_json={'control':'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','char':'','leng':62}
|
| 42 |
text=str(in_list)
|
| 43 |
key_cnt=len(in_list)
|
|
|
|
| 424 |
with gr.Column(scale=3):
|
| 425 |
with gr.Row():
|
| 426 |
inp=gr.Textbox(label="URL")
|
| 427 |
+
level=gr.Slider(minimum=1,maximum=1,step=1,value=1)
|
| 428 |
btn=gr.Button()
|
| 429 |
+
test_btn=gr.Button("Test")
|
| 430 |
key_json=gr.JSON()
|
| 431 |
outp=gr.JSON()
|
| 432 |
with gr.Column(scale=1):
|
| 433 |
outmap=gr.JSON()
|
| 434 |
+
test_btn.click(mega,None,None)
|
| 435 |
+
btn.click(sitemap,[inp,file_state,level],[outp,outmap,key_json])
|
| 436 |
app.launch()
|