acecalisto3 commited on
Commit
aab8343
Β·
1 Parent(s): ab414be
Files changed (2) hide show
  1. app2.py +0 -1
  2. fix.sh +9 -20
app2.py CHANGED
@@ -54,7 +54,6 @@ except ImportError:
54
  logger.warning("python-docx not installed. DOCX file processing will be limited.") # logger is available
55
 
56
  try:
57
- from pyth.plugins.rtf15.reader import Rtf15Reader
58
  from pyth.plugins.plaintext.writer import PlaintextWriter
59
  RTF_SUPPORT = True
60
  except ImportError:
 
54
  logger.warning("python-docx not installed. DOCX file processing will be limited.") # logger is available
55
 
56
  try:
 
57
  from pyth.plugins.plaintext.writer import PlaintextWriter
58
  RTF_SUPPORT = True
59
  except ImportError:
fix.sh CHANGED
@@ -1,29 +1,18 @@
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."
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ echo "πŸ”§ Removing Rtf15Reader import from app2.py..."
5
+ sed -i '/from pyth.plugins.rtf15.reader import Rtf15Reader/d' /home/user/app/app2.py
6
+ echo "βœ… Import removed."
7
 
8
+ echo "πŸ”§ Disabling .rtf file processing..."
 
 
9
 
10
+ # Safely disable .rtf handling inside file processor
11
+ sed -i '/if file_ext == ".rtf":/{
 
 
 
 
 
 
 
 
 
 
 
12
  n
13
+ a\ processing_status_messages.append(f"⚠️ Skipping RTF file {file.name} because RTF processing is disabled.")\n continue
14
  }' /home/user/app/app2.py
15
 
16
+ echo "βœ… RTF files now skipped safely."
17
 
18
+ echo "🎯 All pyth dependencies fully removed and app2.py is adjusted. Restart your app now."