diff --git a/PDMameUpdate.py b/PDMameUpdate.py index 9110a80..968ea0c 100755 --- a/PDMameUpdate.py +++ b/PDMameUpdate.py @@ -24,6 +24,7 @@ Requirements: * Python3 with the libraries below - feedparser - transmission-clutch + - tabulate * Linux (untested on other OS, but it might work) Notes @@ -48,6 +49,7 @@ import re import requests import time from clutch.core import Client +from tabulate import tabulate from collections import defaultdict from pprint import pformat from urllib.parse import quote @@ -137,14 +139,17 @@ def check_and_rewrite_download_url(torrent_data): def prompt_for_update(): """Ask for user confirmation before updating""" - + + outputHeader=["Torrent","from","to"] + output=[] if len(torrents) > 0: for torrent, data in torrents.items(): - print('Torrent {}: {} -> {}'.format( + output.append([ torrent, data['local-version'], data['remote-version'] - )) + ]) + print(tabulate(output,headers=outputHeader,tablefmt="simple")) print('Should I update the torrents listed above? (y/N)') answer = input() if answer.lower() != 'y':