Skip to content

Commit

Permalink
feat: fixed regex
Browse files Browse the repository at this point in the history
  • Loading branch information
VKotwicki committed Aug 1, 2023
1 parent 7ccef41 commit 0d98eeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ options:
-i IGNORE_LIST, --ignore-list IGNORE_LIST
Path to file of list of emails of users to ignore.
-l USER_LIST, --user-list USER_LIST
Sends push notifications only to specified users in a provided file. Userlist format is either one of `email` or `email - phonenumber`. E.g. user-list.txt
Sends push notifications only to specified users in a provided file. Userlist format is either one of `email` or `email,phonenumber`. E.g. user-list.txt
-p PUSH_TEXT, --push-text PUSH_TEXT
Text to display in push notification. Defaults to 'Login'.
-g BY_GROUPS, --by-groups BY_GROUPS
Expand Down
6 changes: 2 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ def get_users_from_list(all_users:list) -> list:
# Gets all users from user list
try:
with open(args.user_list, "r") as file:
spamreader = csv.reader(file, delimiter='-')
filtered_users = { row[0].strip() : re.sub('[\+][^\d]', '', row[1].strip()) if len(row) > 1 else None for row in spamreader }
spamreader = csv.reader(file, delimiter=',')
filtered_users = { row[0].strip() : re.sub('[^\+\d]', '', row[1].strip()) if len(row) > 1 else None for row in spamreader }
except FileNotFoundError:
print(args.user_list, "not found")
exit()
Expand Down Expand Up @@ -391,8 +391,6 @@ def send_notification_query(user_id:str, devices:list, username:str) -> list:
for i in range(0, user_pings):
try:
res = auth_api.auth("push", user_id=user_id, type=args.push_text, device=devices)
### DEBUG: used for testing
# res = {'result': 'Worked', 'status': 'sent', 'status_msg': 'testing'}
except Exception as e:
res = {'result': '', 'status': 'invalid_request', 'status_msg': 'Unable to ping user'}
break
Expand Down

0 comments on commit 0d98eeb

Please sign in to comment.