Changeset c8845e4129ccc08b18467b5028c93885c1aba213 in for resourcetotrac/resourcetotrac/email/util.py
- Timestamp:
- 05/02/09 16:44:28 (3 years ago)
- Children:
- 4e17a72f98bff34332fbca7853ac4aa7b854d997
- Parents:
- 4bceacf6b979775083c8623c2906a66e95eefe48
- git-committer:
- John Hampton <pacopablo@pacopablo.com> / 2009-05-02T16:44:28Z-0700
- File:
-
- 1 edited
-
resourcetotrac/resourcetotrac/email/util.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
resourcetotrac/resourcetotrac/email/util.py
ref235ae rc8845e4 20 20 __all__ = [ 21 21 'strip_re', 22 'get_resource_type', 23 'get_author', 22 'get_author_email', 24 23 'get_cc', 25 24 ] … … 33 32 return subject 34 33 35 def get_ resource_type(msg):36 """ Return s the resource type of the message.34 def get_author(env, msg): 35 """ Return the username of the author based on the From: address 37 36 38 For emails, the resource type is contained in the subject. 39 ticket: 40 [project name] #42: Summary 37 env is a Trac environment. 38 msg is an email object 39 """ 40 address = get_author_email(msg) 41 cnx = env.get_db_cnx() 42 cur = cnx.cursor() 43 cur.execute("SELECT sid FROM session_attribute WHERE name = 'email' AND value = %s", (address,)) 44 cnx.close() 45 cnx = None 41 46 42 wiki: 43 wiki:Path/Of/WikiPage 47 def get_author_email(msg): 48 """ Returns the email of the author """ 49 return parseadr(msg['From'])[1] 44 50 45 milestone: 46 milestone:Milestone Name 51 def get_cc(msg): 52 """ Returns a list of email addresses pulled from the CC list """ 53 return [e[1] for e in getaddresses(msg.get_all('cc', []))] 47 54 48 """
Note: See TracChangeset
for help on using the changeset viewer.
