forked from HasflarSonto/Truely
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_distribution.py
More file actions
135 lines (104 loc) · 3.91 KB
/
create_distribution.py
File metadata and controls
135 lines (104 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env python3
"""
Distribution script for Truely
Creates a clean distribution package with the .app file and config template
"""
import os
import shutil
import subprocess
import sys
from pathlib import Path
def create_distribution():
"""Create a distribution package"""
# Create distribution directory
dist_dir = Path("distribution")
if dist_dir.exists():
shutil.rmtree(dist_dir)
dist_dir.mkdir()
# Copy the .app file
app_source = Path("dist/Truely.app")
app_dest = dist_dir / "Truely.app"
if app_source.exists():
print(f"Copying {app_source} to {app_dest}")
shutil.copytree(app_source, app_dest)
else:
print("Error: Truely.app not found in dist/ directory")
return False
# Create a config template
config_template = """# Truely Configuration File
# Edit these settings as needed
# Zoom meeting URL (replace with your actual meeting URL)
ZOOM_URL = "https://us05web.zoom.us/j/YOUR_MEETING_ID?pwd=YOUR_PASSWORD"
# Applications to monitor (add or remove as needed)
APPS = ["cluely", "claude"]
# Start and end keys for monitoring
START_KEY = "HIHIHI"
END_KEY = "BYEBYE"
# Enable/disable chat monitoring (True/False)
CHAT_MONITORING_ENABLED = True
# Status update interval in seconds
STATUS_UPDATE_INTERVAL = 10
"""
config_path = dist_dir / "config_template.py"
with open(config_path, 'w') as f:
f.write(config_template)
# Create README for distribution
readme_content = """# Truely Distribution
## Installation Instructions
1. **Extract the distribution package** to your desired location
2. **Copy the config file**:
- Copy `config_template.py` to `config.py`
- Edit `config.py` with your actual Zoom meeting URL and settings
3. **Run the application**:
- Double-click `Truely.app` to start the application
- Or right-click and select "Open" if macOS blocks the app
## Configuration
Edit `config.py` to customize:
- **ZOOM_URL**: Your Zoom meeting URL
- **APPS**: List of applications to monitor
- **START_KEY/END_KEY**: Monitoring keys
- **CHAT_MONITORING_ENABLED**: Enable/disable chat monitoring
- **STATUS_UPDATE_INTERVAL**: How often to send status updates
## Troubleshooting
If macOS blocks the app:
1. Go to System Preferences > Security & Privacy
2. Click "Open Anyway" for Truely.app
If the app doesn't start:
1. Make sure `config.py` is in the same directory as `Truely.app`
2. Check that your Zoom URL is valid
3. Ensure you have an internet connection
## Support
For issues or questions, please refer to the main documentation.
"""
readme_path = dist_dir / "README.txt"
with open(readme_path, 'w') as f:
f.write(readme_content)
print(f"\n✅ Distribution created successfully in '{dist_dir}' directory!")
print(f"📁 Contents:")
print(f" - Truely.app (main application)")
print(f" - config_template.py (configuration template)")
print(f" - README.txt (installation instructions)")
print(f"\n📋 Next steps:")
print(f" 1. Copy config_template.py to config.py")
print(f" 2. Edit config.py with your settings")
print(f" 3. Test the app by double-clicking Truely.app")
print(f" 4. Zip the distribution folder for sharing")
return True
def build_and_distribute():
"""Build the app and create distribution"""
print("🔨 Building Truely.app...")
# Run PyInstaller
result = subprocess.run([sys.executable, "-m", "PyInstaller", "truely.spec"],
capture_output=True, text=True)
if result.returncode != 0:
print("❌ Build failed!")
print("Error output:", result.stderr)
return False
print("✅ Build completed successfully!")
# Create distribution
return create_distribution()
if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "--build":
build_and_distribute()
else:
create_distribution()