def bccHeader(self,recipients): """ Give the appropriate Bcc: header for mail-outs from this page. Expects a list of recipient addresses. """ return join(stripList(recipients), ', ')
def bccHeader(self, recipients): # -> string """ Give the appropriate Bcc: header for mail-outs from this page. Expects a list of recipient addresses. """ return ', '.join(stripList(recipients))
def parseSpamPatterns(self, t): """Parse the contents of spampatterns.txt, returning any patterns as a list of strings. spampatterns.txt version 1 may contain: - comments - lines beginning with # - whitespace at the start or end of lines, or blank lines - a line of the form "zwiki-spampatterns-version: 1"; assumed if not present """ return [p for p in stripList(t.split('\n')) if not (p.startswith('#') or p.startswith('zwiki-spampatterns-version:'))]
def _getSubscribers(self, parent=0): """ Return a copy of this page's subscriber list, as a list. With parent flag, manage the parent folder's subscriber list instead. """ if AUTO_UPGRADE: self._upgradeSubscribers() if parent: if hasattr(self.folder(),'subscriber_list'): return stripList(self.folder().subscriber_list) else: return [] else: return list(self.subscriber_list)
def _getSubscribers( self, parent=0 ): # -> [string]; depends on self, folder; modifies self, folder """ Return a copy of this page's subscriber list, as a list. With parent flag, manage the parent folder's subscriber list instead. """ if AUTO_UPGRADE: self._upgradeSubscribers() if parent: if safe_hasattr(self.folder(), 'subscriber_list'): return stripList(self.folder().subscriber_list) else: return [] else: return list(self.subscriber_list)
def subscriberList(self, parent=0, edits=0): """ Return a list of this page's subscribers, without the :edits suffix. A subscriber is represented by a string containing an email address or a CMF username, and an optional :edits suffix indicating they have requested all edits. Note this method strips the :edits suffix. If edits flag is true, return only the subscribers who have requested all edits; otherwise, return all subscribers. If parent flag is true, query the parent folder's subscriber list instead. """ return [re.sub(r':edits$','',s) for s in stripList(self._getSubscribers(parent)) if (not edits) or s.endswith(':edits')]
def subscriberList(self, parent=0, edits=0): # -> [string]; depends on self, folder """ Return a list of this page's subscribers, without the :edits suffix. A subscriber is represented by a string containing an email address or a CMF username, and an optional :edits suffix indicating they have requested all edits. Note this method strips the :edits suffix. If edits flag is true, return only the subscribers who have requested all edits; otherwise, return all subscribers. If parent flag is true, query the parent folder's subscriber list instead. """ return [ re.sub(r':edits$', '', s) for s in stripList(self._getSubscribers(parent)) if (not edits) or s.endswith(':edits') ]