Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,14 +73,24 @@ def get_screenshot(chat,block=[],css_in=css,w=500,h=800,user_c="#367bb9",bot_c="
|
|
| 73 |
print(chat_len)
|
| 74 |
block_box=[]
|
| 75 |
if user_c:
|
| 76 |
-
user_c=user_c.strip('""').strip("''")
|
| 77 |
-
css_in=css_in.replace("$user_c",user_c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
html_body=""
|
| 79 |
if block:
|
| 80 |
for i in range(chat_len):
|
| 81 |
if i+1 in block:
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
for user,bot in chat:
|
| 85 |
html_body += html_user.replace("$chat",user)
|
| 86 |
html_body += html_bot.replace("$chat",bot)
|
|
|
|
| 73 |
print(chat_len)
|
| 74 |
block_box=[]
|
| 75 |
if user_c:
|
| 76 |
+
#user_c=user_c.strip('""').strip("''")
|
| 77 |
+
css_in=css_in.replace("$user_c",user_c)
|
| 78 |
+
if bot_c:
|
| 79 |
+
css_in=css_in.replace("$bot_c",bot_c)
|
| 80 |
+
if background_c:
|
| 81 |
+
css_in=css_in.replace("$background_c",background_c)
|
| 82 |
+
if font_c:
|
| 83 |
+
css_in=css_in.replace("$font_c",font_c)
|
| 84 |
html_body=""
|
| 85 |
if block:
|
| 86 |
for i in range(chat_len):
|
| 87 |
if i+1 in block:
|
| 88 |
+
try:
|
| 89 |
+
block_box.append(chat[i])
|
| 90 |
+
except Exception as e:
|
| 91 |
+
print(e)
|
| 92 |
+
if block_box:
|
| 93 |
+
chat=block_box
|
| 94 |
for user,bot in chat:
|
| 95 |
html_body += html_user.replace("$chat",user)
|
| 96 |
html_body += html_bot.replace("$chat",bot)
|