nntp/nntp.py
def list_newsgroups_gen(self, pattern=None):
        """Generator for the LIST NEWSGROUPS command.

        Generates a list of newsgroups including the name and a short
        description.

        See <http://tools.ietf.org/html/rfc3977#section-7.6.6>

        Args:
            pattern: Glob matching newsgroups of intrest.

        Yields:
            A tuple containing the name, and description for the newsgroup.
        """
        args = pattern

        code, message = self.command("LIST NEWSGROUPS", args)
        if code != 215:
            raise NNTPReplyError(code, message)

        for line in self.info_gen(code, message):
            parts = line.strip().split()
            name, description = parts[0], ""
            if len(parts) > 1:
                description = parts[1]
            yield name, description
def list_newsgroups_gen(self, pattern=None):
        """Generator for the LIST NEWSGROUPS command.

        Generates a list of newsgroups including the name and a short
        description.

        See <http://tools.ietf.org/html/rfc3977#section-7.6.6>

        Args:
            pattern: Glob matching newsgroups of intrest.

        Yields:
            A tuple containing the name, and description for the newsgroup.
        """
        args = pattern

        code, message = self.command("LIST NEWSGROUPS", args)
        if code != 215:
            raise NNTPReplyError(code, message)

        for line in self.info_gen(code, message):
            parts = line.strip().split()
            name, description = parts[0], ""
            if len(parts) > 1:
                description = parts[1]
            yield name, description
def list_newsgroups_gen ( self , pattern = None ) : args = pattern code , message = self . command ( "LIST NEWSGROUPS" , args ) if code != 215 : raise NNTPReplyError ( code , message ) for line in self . info_gen ( code , message ) : parts = line . strip ( ) . split ( ) name , description = parts [ 0 ] , "" if len ( parts ) > 1 : description = parts [ 1 ] yield name , description
Generator for the LIST NEWSGROUPS command.

        Generates a list of newsgroups including the name and a short
        description.

        See <http://tools.ietf.org/html/rfc3977#section-7.6.6>

        Args:
            pattern: Glob matching newsgroups of intrest.

        Yields:
            A tuple containing the name, and description for the newsgroup.
Generator for the LIST NEWSGROUPS command .