Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -224,16 +224,16 @@ class FileProcessor:
|
|
224 |
try:
|
225 |
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
226 |
content = f.read()
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
|
238 |
def _process_single_file(self, file) -> List[Dict]:
|
239 |
try:
|
|
|
224 |
try:
|
225 |
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
226 |
content = f.read()
|
227 |
+
if content.strip():
|
228 |
+
results.append({
|
229 |
+
"source": "file",
|
230 |
+
"filename": filename,
|
231 |
+
"content": content,
|
232 |
+
"timestamp": datetime.now().isoformat()
|
233 |
+
})
|
234 |
+
except Exception as e:
|
235 |
+
logger.error(f"Error reading file {filename}: {str(e)}")
|
236 |
+
return results
|
237 |
|
238 |
def _process_single_file(self, file) -> List[Dict]:
|
239 |
try:
|