File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
# !/usr/bin/env python3
2
2
# -*- coding: utf-8 -*-
3
3
4
- import random
5
4
import os
6
5
import subprocess
7
6
from twilio .base .exceptions import TwilioRestException
8
7
from twilio .rest import Client
8
+ import secrets
9
9
10
10
11
11
def get_dotenv ():
@@ -70,7 +70,7 @@ def main():
70
70
client .messages .create (
71
71
to = number_of_boss ,
72
72
from_ = my_number ,
73
- body = 'Gonna work from home. ' + random .choice (excuses ),
73
+ body = 'Gonna work from home. ' + secrets . SystemRandom () .choice (excuses ),
74
74
)
75
75
except TwilioRestException as e :
76
76
# Log errors.
Original file line number Diff line number Diff line change 2
2
#!/usr/bin/env python
3
3
4
4
import os
5
- import random
6
5
from twilio .rest import Client # Updated import for newer Twilio versions
7
6
import subprocess
8
7
import sys
9
8
from time import strftime
9
+ import secrets
10
10
11
11
# Exit if no sessions with my username are found
12
12
output = subprocess .check_output ('who' )
34
34
client .messages .create (
35
35
to = her_number ,
36
36
from_ = my_number ,
37
- body = "Late at work. " + random .choice (reasons )
37
+ body = "Late at work. " + secrets . SystemRandom () .choice (reasons )
38
38
)
39
39
40
40
# Print confirmation message
You can’t perform that action at this time.
0 commit comments