コード例 #1
0
def main(args=None):
    args = docopt(to_string(__doc__), args, version=__version__)
    summarizer, parser, items_count = handle_arguments(args)

    for sentence in summarizer(parser.document, items_count):
        if PY3:
            print(to_unicode(sentence))
        else:
            print(to_bytes(sentence))

    return 0
コード例 #2
0
def test_repr_object_to_bytes():
    value = UNICODE_STRING if py3k.PY3 else BYTES_STRING
    instance = _build_test_instance("__repr__", value)

    returned = py3k.to_bytes(instance)
    _assert_strings_equal(BYTES_STRING, returned)
コード例 #3
0
def test_unicode_object_to_bytes():
    instance = _build_test_instance("__str__", UNICODE_STRING)

    returned = py3k.to_bytes(instance)
    _assert_strings_equal(BYTES_STRING, returned)
コード例 #4
0
def test_unicode_to_bytes():
    returned = py3k.to_bytes(UNICODE_STRING)
    _assert_strings_equal(BYTES_STRING, returned)
コード例 #5
0
def test_bytes_to_bytes():
    returned = py3k.to_bytes(BYTES_STRING)
    _assert_strings_equal(BYTES_STRING, returned)
コード例 #6
0
def test_to_bytes():
    returned = compat.to_bytes(O())
    _assert_strings_equal(BYTES_STRING, returned)