Ejemplo n.º 1
0
async def status_handler(args):
    async with ControlClient() as client:
        torrent_states = await client.execute(status_server_handler)
    
    paragraphs = [formatters.join_lines(formatters.format_title(state, args.verbose) +
                                        formatters.format_status(state, args.verbose))
                  for state in torrent_states]
    print('\n'.join(paragraphs).rstrip())
Ejemplo n.º 2
0
async def status_handler(args):
    async with ControlClient() as client:
        torrent_states = await client.execute(status_server_handler)
    if not torrent_states:
        print('No torrents added')
        return

    paragraphs = [formatters.join_lines(formatters.format_title(state, args.verbose) +
                                        formatters.format_status(state, args.verbose))
                  for state in torrent_states]
    print('\n'.join(paragraphs).rstrip())
Ejemplo n.º 3
0
def show_handler(args):
    torrent_info = TorrentInfo.from_file(args.filename, download_dir=None)
    content_description = formatters.join_lines(
        formatters.format_title(torrent_info, True) + formatters.format_content(torrent_info))
    print(content_description, end='')
Ejemplo n.º 4
0
def show_handler(args):#getting announce urls and download info from bencoded .torrent file.....
    torrent_info = TorrentInfo.from_file(args.filename, download_dir=None)
    content_description = formatters.join_lines(
        formatters.format_title(torrent_info, True) + formatters.format_content(torrent_info))
    print(content_description, end='')