-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
97 lines (74 loc) · 2.44 KB
/
main.py
File metadata and controls
97 lines (74 loc) · 2.44 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
#!/usr/bin/env python3
"""
GitGuard - GitHub Security Scanner
Main Entry Point
This script launches the GitGuard GUI application for scanning GitHub
repositories and detecting sensitive information.
Usage:
python main.py
Requirements:
- Python 3.10+
- All dependencies from requirements.txt installed
- GitHub credentials (Personal Access Token or username/password)
Security Note:
GitGuard processes all data locally and does not transmit any
information to external services. Your GitHub credentials and
scan results remain private and secure.
"""
import sys
import os
# Add src directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
def check_dependencies():
"""Check if required dependencies are installed."""
missing_deps = []
try:
import tkinter
except ImportError:
missing_deps.append("tkinter (usually comes with Python)")
try:
from github import Github
except ImportError:
missing_deps.append("PyGithub")
try:
import requests
except ImportError:
missing_deps.append("requests")
if missing_deps:
print("ERROR: Missing required dependencies:")
for dep in missing_deps:
print(f" - {dep}")
print("\nPlease install dependencies with:")
print(" pip install -r requirements.txt")
print(" # Or: pip3 install -r requirements.txt")
return False
return True
def main():
"""Main entry point for GitGuard application."""
print("GitGuard - GitHub Security Scanner v1.0.0")
print("=" * 45)
print()
# Check dependencies
if not check_dependencies():
sys.exit(1)
print("✅ All dependencies found")
print("🚀 Starting GitGuard GUI...")
print()
try:
# Import and start GUI
from gui import GitGuardGUI
app = GitGuardGUI()
app.run()
except ImportError as e:
print(f"❌ Failed to import GitGuard modules: {e}")
print("Make sure all source files are present in the src/ directory")
sys.exit(1)
except KeyboardInterrupt:
print("\n🛑 Application interrupted by user")
sys.exit(0)
except Exception as e:
print(f"❌ Unexpected error: {e}")
print("Please check your Python environment and dependencies")
sys.exit(1)
if __name__ == "__main__":
main()