-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_campaign.py
31 lines (26 loc) · 875 Bytes
/
run_campaign.py
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
#!/usr/bin/env python3
import os
import sys
import argparse
def setup_environment():
"""Set up environment variables and paths."""
# Add project root to Python path
project_root = os.path.dirname(os.path.abspath(__file__))
if project_root not in sys.path:
sys.path.insert(0, project_root)
# Create necessary directories
directories = ['templates', 'attachments', 'logs', 'data']
for directory in directories:
os.makedirs(directory, exist_ok=True)
if __name__ == "__main__":
# Set up environment
setup_environment()
# Import after environment setup
try:
from email_campaign.main import main
except ImportError as e:
print(f"Import error: {e}")
print("Make sure all required files are in the correct locations.")
sys.exit(1)
# Run the campaign
sys.exit(main())