nntp/utils.py
def unparse_range(obj):
    """Unparse a range argument.

    Args:
        obj: An article range. There are a number of valid formats; an integer
            specifying a single article or a tuple specifying an article range.
            If the range doesn't give a start article then all articles up to
            the specified last article are included. If the range doesn't
            specify a last article then all articles from the first specified
            article up to the current last article for the group are included.

    Returns:
        The range as a string that can be used by an NNTP command.

    Note: Sample valid formats.
        4678
        (,5234)
        (4245,)
        (4245, 5234)
    """
    if isinstance(obj, (int, long)):
        return str(obj)

    if isinstance(obj, tuple):
        arg = str(obj[0]) + "-"
        if len(obj) > 1:
            arg += str(obj[1])
        return arg

    raise ValueError("Must be an integer or tuple")
def unparse_range(obj):
    if isinstance(obj, (int, long)):
        return str(obj)

    if isinstance(obj, tuple):
        arg = str(obj[0]) + "-"
        if len(obj) > 1:
            arg += str(obj[1])
        return arg

    raise ValueError("Must be an integer or tuple")
def unparse_range ( obj ) : if isinstance ( obj , ( int , long ) ) : return str ( obj ) if isinstance ( obj , tuple ) : arg = str ( obj [ 0 ] ) + "-" if len ( obj ) > 1 : arg += str ( obj [ 1 ] ) return arg raise ValueError ( "Must be an integer or tuple" )
Unparse a range argument.

    Args:
        obj: An article range. There are a number of valid formats; an integer
            specifying a single article or a tuple specifying an article range.
            If the range doesn't give a start article then all articles up to
            the specified last article are included. If the range doesn't
            specify a last article then all articles from the first specified
            article up to the current last article for the group are included.

    Returns:
        The range as a string that can be used by an NNTP command.

    Note: Sample valid formats.
        4678
        (,5234)
        (4245,)
        (4245, 5234)
Unparse a range argument .