Private
Public Access
remove old pys laying out in the main dir
This commit is contained in:
@@ -1,54 +0,0 @@
|
|||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
def check_ai_client(path):
|
|
||||||
with open(path, 'r', encoding='utf-8') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
|
|
||||||
imports = []
|
|
||||||
internal_imports = []
|
|
||||||
for i, line in enumerate(lines):
|
|
||||||
stripped = line.strip()
|
|
||||||
if stripped.startswith('import ') or stripped.startswith('from '):
|
|
||||||
if line.startswith('import ') or line.startswith('from '):
|
|
||||||
imports.append((i+1, stripped))
|
|
||||||
else:
|
|
||||||
internal_imports.append((i+1, stripped, line.split(stripped[0])[0]))
|
|
||||||
|
|
||||||
print("--- Top-level imports ---")
|
|
||||||
for lno, imp in imports:
|
|
||||||
print(f"{lno}: {imp}")
|
|
||||||
|
|
||||||
print("\n--- Internal imports ---")
|
|
||||||
for lno, imp, indent in internal_imports:
|
|
||||||
print(f"{lno}: [{len(indent)} spaces] {imp}")
|
|
||||||
|
|
||||||
print("\n--- Duplicate top-level imports ---")
|
|
||||||
seen = set()
|
|
||||||
for lno, imp in imports:
|
|
||||||
if imp in seen:
|
|
||||||
print(f"Duplicate: {lno}: {imp}")
|
|
||||||
seen.add(imp)
|
|
||||||
|
|
||||||
print("\n--- Indentation check (first non-space character not at index 0 or multiple of 1) ---")
|
|
||||||
# Actually, if it's 1-space indentation, any number of spaces is valid at the start?
|
|
||||||
# No, if it's 1-space indentation, it means each level is 1 space.
|
|
||||||
# So 0, 1, 2, 3... are all valid.
|
|
||||||
# BUT if someone used 4 spaces for 1 level, that's wrong.
|
|
||||||
# The only way to know is to see the context.
|
|
||||||
# But the prompt says "Ensure the entire file uses exactly 1-space indentation."
|
|
||||||
# This usually means convert 4-space to 1-space.
|
|
||||||
|
|
||||||
# Let's just check for lines starting with 4 spaces that might be 1 level.
|
|
||||||
# Or better, look for any line where indentation is not exactly 1 space more than parent.
|
|
||||||
# That's hard without parsing.
|
|
||||||
|
|
||||||
# Let's look for common 4-space patterns.
|
|
||||||
four_spaces = 0
|
|
||||||
for i, line in enumerate(lines):
|
|
||||||
if line.startswith(' ') and not line.startswith(' '):
|
|
||||||
four_spaces += 1
|
|
||||||
print(f"Lines starting with exactly 4 spaces: {four_spaces}")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
check_ai_client('src/ai_client.py')
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
def check_indent(file_path):
|
|
||||||
with open(file_path, 'r', encoding='utf-8') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
|
|
||||||
last_indent = 0
|
|
||||||
for i, line in enumerate(lines):
|
|
||||||
stripped = line.lstrip()
|
|
||||||
if not stripped:
|
|
||||||
continue
|
|
||||||
|
|
||||||
indent = len(line) - len(line.lstrip())
|
|
||||||
if indent > last_indent + 1:
|
|
||||||
print(f"Jump at line {i+1}: '{line.rstrip()}' (Indent: {indent}, Last: {last_indent})")
|
|
||||||
last_indent = indent
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
check_indent('src/app_controller.py')
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
from unittest.mock import MagicMock, patch
|
|
||||||
from src.gui_2 import App
|
|
||||||
import sys
|
|
||||||
|
|
||||||
app = MagicMock()
|
|
||||||
app.mma_streams = {}
|
|
||||||
app._pending_mma_spawns = [{"ticket_id": "T-001"}]
|
|
||||||
app._pending_mma_approvals = []
|
|
||||||
app._pending_ask_dialog = False
|
|
||||||
app.is_viewing_prior_session = False
|
|
||||||
app.mma_status = "idle"
|
|
||||||
app.active_track = None
|
|
||||||
app.active_tickets = []
|
|
||||||
app.mma_tier_usage = {
|
|
||||||
"Tier 1": {"input": 0, "output": 0, "model": "gemini-3.1-pro-preview"},
|
|
||||||
"Tier 2": {"input": 0, "output": 0, "model": "gemini-3-flash-preview"},
|
|
||||||
"Tier 3": {"input": 0, "output": 0, "model": "gemini-2.5-flash-lite"},
|
|
||||||
"Tier 4": {"input": 0, "output": 0, "model": "gemini-2.5-flash-lite"},
|
|
||||||
}
|
|
||||||
app.perf_profiling_enabled = False
|
|
||||||
|
|
||||||
with patch("src.gui_2.imgui") as mock_imgui:
|
|
||||||
App._render_mma_dashboard(app)
|
|
||||||
print(f"text_colored called: {mock_imgui.text_colored.called}")
|
|
||||||
if not mock_imgui.text_colored.called:
|
|
||||||
print("Calls to app methods:")
|
|
||||||
for call in app.mock_calls:
|
|
||||||
print(call)
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
def fix_indentation(file_path):
|
|
||||||
with open(file_path, 'r', encoding='utf-8') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
|
|
||||||
fixed_lines = []
|
|
||||||
indent_map = {0: 0}
|
|
||||||
|
|
||||||
for i, line in enumerate(lines):
|
|
||||||
stripped = line.lstrip()
|
|
||||||
if not stripped:
|
|
||||||
fixed_lines.append('\n')
|
|
||||||
continue
|
|
||||||
|
|
||||||
old_indent = len(line) - len(stripped)
|
|
||||||
|
|
||||||
# Remove larger indents from map if we dedent below them
|
|
||||||
for k in list(indent_map.keys()):
|
|
||||||
if k > old_indent:
|
|
||||||
del indent_map[k]
|
|
||||||
|
|
||||||
if old_indent not in indent_map:
|
|
||||||
# Find the closest smaller indent
|
|
||||||
known = sorted([k for k in indent_map.keys() if k < old_indent])
|
|
||||||
parent_new = indent_map[max(known)]
|
|
||||||
indent_map[old_indent] = parent_new + 1
|
|
||||||
|
|
||||||
new_indent = indent_map[old_indent]
|
|
||||||
fixed_lines.append(' ' * new_indent + stripped)
|
|
||||||
|
|
||||||
with open(file_path, 'w', encoding='utf-8') as f:
|
|
||||||
f.writelines(fixed_lines)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
fix_indentation('src/app_controller.py')
|
|
||||||
print("Indentation fixed v3.")
|
|
||||||
Reference in New Issue
Block a user