django-restit 4.2.123__py3-none-any.whl → 4.2.124__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-restit
3
- Version: 4.2.123
3
+ Version: 4.2.124
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -91,7 +91,7 @@ inbox/models/message.py,sha256=acPm2z0QsucoFFmfzPekehElZm8EMzkcGChX_BpzGLU,3758
91
91
  inbox/models/template.py,sha256=i5vf0vsM1U0251UmVsF61MDCV_c7xt-zdCdx1SiKOG0,1013
92
92
  inbox/rpc.py,sha256=7JXvpXlEGKG7by_NkANPGYLCzagyCnTIGM4rme_htpk,1534
93
93
  inbox/utils/__init__.py,sha256=P_UR2rGK3L0tZNlTN-mf99tpeYM-tLkA18iDKXSSLDM,89
94
- inbox/utils/parsing.py,sha256=ae8JKm10qg6Q3dGhC29oDKKycN3yeDxI6e9SryPKxcY,4615
94
+ inbox/utils/parsing.py,sha256=cU5qHaVNkje21b3ApeCixYQEuCsQl0gM8FeLz9DPgs0,5340
95
95
  inbox/utils/render.py,sha256=CU_F2qUBQE7mjb9Q6Dn9ro5CS_O_zEY-wDMHEClKkIA,4331
96
96
  inbox/utils/sending.py,sha256=BKelTZnbkdSLGpjOY6IRTrzj-Hnw2pPZ7RYQGwe-tqk,2179
97
97
  incident/README.md,sha256=4vbZTJj7uUmq8rogYngxqNYjFTlBOujfWUGheLoFKMc,1114
@@ -374,7 +374,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
374
374
  rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
375
375
  rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
376
376
  rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
377
- rest/__init__.py,sha256=9U4bbRpojdF2iTaNZzy6i2wcFFL4PyJAXf243H2cR_w,122
377
+ rest/__init__.py,sha256=0sxcxXwa77weXIPiDP-LewT4mLGu6lY2A65XEW1RCGw,122
378
378
  rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
379
379
  rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
380
380
  rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
@@ -509,7 +509,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
509
509
  ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
510
510
  ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
511
511
  ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
512
- django_restit-4.2.123.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
513
- django_restit-4.2.123.dist-info/METADATA,sha256=HGtIB4-fKEK2kSVmhVJ0a3uo7qH0DTy1r_P1xskGYG4,7663
514
- django_restit-4.2.123.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
515
- django_restit-4.2.123.dist-info/RECORD,,
512
+ django_restit-4.2.124.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
513
+ django_restit-4.2.124.dist-info/METADATA,sha256=5OsAl5Cp2yoBJ4kunwsuMVsBTBtLiU2WeG95NFiZar8,7663
514
+ django_restit-4.2.124.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
515
+ django_restit-4.2.124.dist-info/RECORD,,
inbox/utils/parsing.py CHANGED
@@ -1,5 +1,7 @@
1
1
  from io import StringIO
2
2
  import email
3
+ import re
4
+
3
5
  from email.utils import parseaddr, parsedate_to_datetime, getaddresses
4
6
  from email.header import decode_header
5
7
 
@@ -129,6 +131,24 @@ def toFileObject(attachment):
129
131
  return obj
130
132
 
131
133
 
134
+ def parseAddresses(input_string):
135
+ # Define a regex pattern to capture email addresses
136
+ email_pattern = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
137
+ # Find all matches of the pattern in the input string
138
+ emails = re.findall(email_pattern, input_string)
139
+ # Create a list to hold parsed email data
140
+ parsed_emails = []
141
+ for addr in emails:
142
+ # Extract name if it exists
143
+ name_match = re.search(r'([a-zA-Z\s]+)?\s*<{}>'.format(re.escape(addr)), input_string)
144
+ if name_match and name_match.group(1):
145
+ name = name_match.group(1).strip()
146
+ else:
147
+ name = None
148
+ parsed_emails.append(objict(name=name, email=addr))
149
+ return parsed_emails
150
+
151
+
132
152
  def toString(value):
133
153
  if isinstance(value, bytes):
134
154
  value = value.decode()
rest/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .uberdict import UberDict # noqa: F401
2
2
  from .settings_helper import settings # noqa: F401
3
3
 
4
- __version__ = "4.2.123"
4
+ __version__ = "4.2.124"