Spaces:
Running
Running
Commit
Β·
2122090
1
Parent(s):
5ab5d61
fixes
Browse files
app2.py
CHANGED
@@ -1481,7 +1481,7 @@ def create_modern_interface():
|
|
1481 |
# When QR codes are generated, update the state with the list of paths
|
1482 |
# and initialize the enabled_qr_codes state with all indices enabled
|
1483 |
if qr_paths_list is None:
|
1484 |
-
|
1485 |
else:
|
1486 |
else:
|
1487 |
num_qrs=len(qr_paths_list)
|
|
|
1481 |
# When QR codes are generated, update the state with the list of paths
|
1482 |
# and initialize the enabled_qr_codes state with all indices enabled
|
1483 |
if qr_paths_list is None:
|
1484 |
+
num_qrs=0
|
1485 |
else:
|
1486 |
else:
|
1487 |
num_qrs=len(qr_paths_list)
|
fix.sh
CHANGED
@@ -1,25 +1,29 @@
|
|
1 |
#!/bin/bash
|
2 |
-
|
3 |
|
4 |
-
echo "π§ Fixing
|
5 |
|
6 |
-
#
|
7 |
-
sed -i '
|
|
|
8 |
|
9 |
-
echo "β
|
10 |
|
11 |
-
echo "π§ Fixing
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
s/^[^ ].*/ &/
|
18 |
}' /home/user/app/app2.py
|
19 |
|
20 |
-
#
|
21 |
-
sed -i '
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
echo "β
|
24 |
|
25 |
-
echo "π― All
|
|
|
1 |
#!/bin/bash
|
2 |
+
set -e
|
3 |
|
4 |
+
echo "π§ Fixing reader.py ur'' syntax error..."
|
5 |
|
6 |
+
# Force-correct the ur'...' to r'...' (handles single and double quotes)
|
7 |
+
sed -i 's/ur"HYPERLINK/r"HYPERLINK/' /usr/local/lib/python3.10/site-packages/pyth/plugins/rtf15/reader.py
|
8 |
+
sed -i "s/ur'HYPERLINK/r'HYPERLINK/" /usr/local/lib/python3.10/site-packages/pyth/plugins/rtf15/reader.py
|
9 |
|
10 |
+
echo "β
reader.py fixed."
|
11 |
|
12 |
+
echo "π§ Fixing app2.py indentation error..."
|
13 |
|
14 |
+
# Add indentation after 'if qr_paths_list is None:'
|
15 |
+
sed -i '/if qr_paths_list is None:/{
|
16 |
+
n
|
17 |
+
s/^/ /
|
|
|
18 |
}' /home/user/app/app2.py
|
19 |
|
20 |
+
# Fix else and its block too
|
21 |
+
sed -i '/^else:$/{
|
22 |
+
s/^/ /
|
23 |
+
n
|
24 |
+
s/^/ /
|
25 |
+
}' /home/user/app/app2.py
|
26 |
|
27 |
+
echo "β
app2.py indentation fixed."
|
28 |
|
29 |
+
echo "π― All runtime blockers patched. Restart app now."
|