From 1cf0de8fad17dcf729a8d8e6df0688a228aff3d7 Mon Sep 17 00:00:00 2001 From: William East Date: Sat, 2 Jul 2022 00:35:25 +0200 Subject: [PATCH] clean up from testing, disabling downloads --- .gitignore | 3 +++ functions.py | 18 ++---------------- main.py | 15 ++++++--------- shell.nix | 2 +- 4 files changed, 12 insertions(+), 26 deletions(-) create mode 100644 .gitignore mode change 100644 => 100755 main.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f710c02 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +config.yaml +.direnv +__pycache__ diff --git a/functions.py b/functions.py index cd44344..3d6a2bb 100644 --- a/functions.py +++ b/functions.py @@ -25,9 +25,6 @@ def checkIfFolder(path): return is_Folder -print(checkIfFolder("/home/weast/Downloads/cover")) - - def torrentIdentifier(directory): torrents = [] with os.scandir(directory) as localdir: @@ -45,11 +42,11 @@ def getDiffList(a, b): return difflist -# Todo: handle file already exists +# TODO: handle file already exists def moveManager(torrents, torrent_dir): for torrent in torrents: try: - shutil.move(torrent, torrent_dir) + shutil.move(torrent.path, torrent_dir) except Exception as e: raise Exception(e) @@ -162,17 +159,6 @@ def download_ftp_tree( overwrite=False, guess_by_extension=True, ): - """ - Downloads an entire directory tree from an ftp server to the local destination - :param ftp_handle: an authenticated ftplib.FTP instance - :param path: the folder on the ftp server to download - :param destination: the local directory to store the copied folder - :param pattern: Python regex pattern, only files that match this pattern will be downloaded. - :param overwrite: set to True to force re-download of all files, even if they appear to exist already - :param guess_by_extension: It takes a while to explicitly check if every item is a directory or a file. - if this flag is set to True, it will assume any file ending with a three character extension ".???" is - a file and not a directory. Set to False if some folders may have a "." in their names -4th position. - """ path = path.lstrip("/") original_directory = ( os.getcwd() diff --git a/main.py b/main.py old mode 100644 new mode 100755 index 281f014..7961c23 --- a/main.py +++ b/main.py @@ -5,9 +5,6 @@ import functions import connectionhandler -# from time import sleep - - # handle argument parsing parser = argparse.ArgumentParser( description="This tool finds .torrent files in your download folder\ @@ -35,12 +32,12 @@ action="store_true", help="move files in inbound folder to outbound torrent folder", ) # move torrent files locally -parser.add_argument( - "--download", - "-d", - action="store_true", - help="Download torrents from seedbox.io to the specified folder.", -) # download torrents +# parser.add_argument( +# "--download", +# "-d", +# action="store_true", +# help="Download torrents from seedbox.io to the specified folder.", +# ) # download torrents args = parser.parse_args() diff --git a/shell.nix b/shell.nix index 06055bf..22f3a58 100644 --- a/shell.nix +++ b/shell.nix @@ -5,4 +5,4 @@ let python-packages.libtorrent-rasterbar ]; my-python = python37.withPackages my-python-packages; -in mkShell { buildInputs = [ bashInteractive my-python ]; } +in mkShell { buildInputs = [ bashInteractive my-python libressl ]; }