#!/usr/bin/env python3
"""Manually test spreadsheet to see the actual error"""
import sys
sys.path.insert(0, 'web2py')

from gluon.contrib.spreadsheet import Sheet

# Try to instantiate a Sheet
try:
    sheet = Sheet(10, 10, 'http://test/callback')
    print(f"✓ Sheet created successfully: {sheet}")
    print(f"  Type: {type(sheet)}")
    print(f"  Dir: {[x for x in dir(sheet) if not x.startswith('_')]}")
except Exception as e:
    print(f"✗ Error creating Sheet: {e}")
    import traceback
    traceback.print_exc()

# Try to process a request-like object
print("\n[*] Testing process() method...")
try:
    class FakeRequest:
        def __init__(self):
            self.vars = {'r0c0': 'test'}
    
    fake_req = FakeRequest()
    result = sheet.process(fake_req)
    print(f"✓ process() succeeded: {result}")
except Exception as e:
    print(f"✗ Error in process(): {e}")
    import traceback
    traceback.print_exc()
