Initial commit: Tablet lending system with user-tablet many-to-many relationship
- Database schema: tablets, users, loans (junction table) - CLI app: minimal_app.py - Web apps: app.py (Flask), simple_app.py (http.server) - Features: loan management, search, user loans view, project notes - Git structure: CONTRIBUTING.md, .gitignore Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
commit
8a8d2f02fa
25 changed files with 2885 additions and 0 deletions
60
setup.py
Normal file
60
setup.py
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Setup script for Tablet Management System
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
|
||||
def install_dependencies():
|
||||
"""Install required dependencies"""
|
||||
try:
|
||||
# Try to install Flask using pip
|
||||
subprocess.check_call([sys.executable, '-m', 'ensurepip', '--upgrade'])
|
||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', 'pip'])
|
||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'Flask==2.3.3'])
|
||||
print("✓ Dependencies installed successfully")
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"✗ Failed to install dependencies: {e}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"✗ Error during installation: {e}")
|
||||
return False
|
||||
|
||||
def check_dependencies():
|
||||
"""Check if required dependencies are available"""
|
||||
try:
|
||||
import flask
|
||||
import sqlite3
|
||||
print("✓ All dependencies are available")
|
||||
return True
|
||||
except ImportError as e:
|
||||
print(f"✗ Missing dependency: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
print("Setting up Tablet Management System...")
|
||||
|
||||
# Check if dependencies are already available
|
||||
if not check_dependencies():
|
||||
print("Installing required dependencies...")
|
||||
if not install_dependencies():
|
||||
print("\nError: Could not install dependencies.")
|
||||
print("Please install Flask manually:")
|
||||
print(" pip install Flask==2.3.3")
|
||||
print("or")
|
||||
print(" python3 -m pip install Flask==2.3.3")
|
||||
return False
|
||||
|
||||
print("\nSetup complete!")
|
||||
print("\nTo run the application:")
|
||||
print(" python3 app.py")
|
||||
print("\nThe application will be available at: http://localhost:5000")
|
||||
|
||||
return True
|
||||
|
||||
if __name__ == '__main__':
|
||||
success = main()
|
||||
sys.exit(0 if success else 1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue