Add framework.logger compatibility shim

This commit is contained in:
2026-01-19 21:14:55 +09:00
parent 2512161203
commit 6e747abf86
5 changed files with 184 additions and 0 deletions

35
test_list.py Normal file
View File

@@ -0,0 +1,35 @@
import os
import sys
# Add the project path to sys.path
project_path = '/Volumes/WD/Users/Work/python/ff_dev_plugins/gds_dviewer'
sys.path.append(project_path)
# Mocking and environment setup might be needed, but let's try to load the logic
from logic import LogicExplorer
class MockPlugin:
def __init__(self):
self.ModelSetting = MockSetting()
self.logger = MockLogger()
class MockSetting:
def get(self, key):
if key == 'root_path': return '/Volumes/WD/Users/Work/python/flaskfarm/data/video'
return None
def get_bool(self, key):
return False
class MockLogger:
def debug(self, msg): print(f"DEBUG: {msg}")
def info(self, msg): print(f"INFO: {msg}")
def error(self, msg): print(f"ERROR: {msg}")
# This might fail due to Flask context or DB initialization
# But we can try to see if it works with the existing app context if we can import it
# Since it's a plugin, it usually depends on the framework 'F'
print("Attempting to test list_directory...")
# In a real environment, we'd need to be careful about DB access.
# If I can't run this, I'll use another way.