From f6dd178a904fb347a91df9bb974eaee67d708498 Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Fri, 3 Dec 2021 00:15:08 +0100 Subject: [PATCH] add BDInfo as package data --- MANIFEST.in | 3 ++- differential/plugins/base.py | 2 +- setup.py | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 3deacce..8501028 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include pyproject.toml -exclude usage.gif \ No newline at end of file +exclude usage.gif +include differential/tools/**/* \ No newline at end of file diff --git a/differential/plugins/base.py b/differential/plugins/base.py index 064f84c..e7c8829 100644 --- a/differential/plugins/base.py +++ b/differential/plugins/base.py @@ -246,7 +246,7 @@ def _get_bdinfo(self) -> str: f'''"{os.path.join(os.path.dirname(tools.__file__), 'BDinfoCli.0.7.3/BDInfo.exe')}" -w ''' f'"{f.parent}" {temp_dir}', abort=True) - for info in tempfile.glob("*.txt"): + for info in Path(temp_dir).glob("*.txt"): with info.open('r') as f: content = f.read() if self.use_short_bdinfo: diff --git a/setup.py b/setup.py index a113a6c..d319366 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,14 @@ #!/usr/bin/env python +from glob import glob from setuptools import setup, find_packages setup( name="Differential", packages=find_packages(), + include_package_data=True, + package_data={ + 'differential': glob('tools/**/*') + }, long_description=open("README.md", "r", encoding='utf-8').read(), long_description_content_type="text/markdown", description="a Python script for easy uploading torrents to varies PT sites.",