12345678910111213141516171819 |
- #!/usr/bin/python3
- # Style Guide for Python Code https://www.python.org/dev/peps/pep-0008/
- # Docstring Conventions https://www.python.org/dev/peps/pep-0257/
- # Based upon:
- # https://www.sympa.org/distribution/contrib/sympa_extract.pl
- class Instance:
- def __init__(self, conn):
- self._conn = conn
- def get_subscribers(self, list, robot):
- rows = ["user_subscriber", "list_subscriber"]
- cur = self._conn.cursor()
- cur.execute("""SELECT %s FROM subscriber_table WHERE list_subscriber LIKE %%s AND robot_subscriber LIKE %%s""" % (",".join(rows)) , (list, robot))
- subscribers = []
- for item in cur:
- email = item[0].lower()
- subscribers.append(email)
- return subscribers
|