heathrow 0.2__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {heathrow-0.2 → heathrow-0.2.2}/PKG-INFO +1 -1
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/__init__.py +6 -6
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/util.py +5 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/windows/dialogue.py +2 -6
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow.egg-info/PKG-INFO +1 -1
- heathrow-0.2.2/src/heathrow.egg-info/scm_version.json +8 -0
- heathrow-0.2/src/heathrow.egg-info/scm_version.json +0 -8
- {heathrow-0.2 → heathrow-0.2.2}/.gitignore +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/.gitlab-ci.yml +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/COPYING +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/Makefile +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/README.txt +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/pyproject.toml +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/setup.cfg +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/bencode.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/bitset.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/constants.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/discovery/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/discovery/base.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/discovery/destination.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/base.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/basic.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/constants.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/windows/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/windows/base.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/windows/root.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/driver/heathrow/windows/splash.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/economy/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/economy/base.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/economy/proto.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/economy/reference.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/fileset/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/fileset/base.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/fileset/v1.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/main.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/messages.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/wire/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/wire/base.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/wire/buffered.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/wire/ltep.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/wire/reticulated.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow/wire/reticulated_v2.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow.egg-info/SOURCES.txt +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow.egg-info/dependency_links.txt +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow.egg-info/entry_points.txt +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow.egg-info/requires.txt +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow.egg-info/scm_file_list.json +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/src/heathrow.egg-info/top_level.txt +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fileset/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fileset/fixtures/v1_basic.torrent +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fileset/test_v1.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fixtures/constants.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fixtures/economy.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fixtures/reticulum_config/.gitignore +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fixtures/reticulum_config/config +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/fixtures/wire.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/module/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/module/test_discovery.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/module/test_wire.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/test_bencode.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/test_bitset.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/wire/__init__.py +0 -0
- {heathrow-0.2 → heathrow-0.2.2}/tests/wire/test_reticulated.py +0 -0
|
@@ -19,7 +19,7 @@ from heathrow.bencode import bencode, bdecode
|
|
|
19
19
|
|
|
20
20
|
from ..base import Driver
|
|
21
21
|
from .constants import CONFIG_IDENTITY, CONFIG_METADATA, CONFIG_RESUME
|
|
22
|
-
from .util import string_to_fileset
|
|
22
|
+
from .util import string_to_fileset, id_to_filename
|
|
23
23
|
from .windows import TUIWindow, SplashWindow
|
|
24
24
|
|
|
25
25
|
|
|
@@ -50,7 +50,7 @@ class HeathrowDriverConfig:
|
|
|
50
50
|
parser.add_argument("targets", help="Start downloading these magnet link / file URIs", nargs="*")
|
|
51
51
|
args = parser.parse_args()
|
|
52
52
|
discovery = getattr(heathrow.discovery, args.discovery + "Discovery")
|
|
53
|
-
wirefactory = getattr(heathrow.wire, args.
|
|
53
|
+
wirefactory = getattr(heathrow.wire, args.wire + "WireFactory")
|
|
54
54
|
fileset = getattr(heathrow.fileset, args.fileset + "Fileset")
|
|
55
55
|
economy = getattr(heathrow.economy, args.economy + "Economy")
|
|
56
56
|
return cls(config_dir=args.config_directory, tui=args.tui, debug=args.debug, discovery=discovery, wirefactory=wirefactory, fileset=fileset, economy=economy, targets=args.targets)
|
|
@@ -94,7 +94,7 @@ class HeathrowDriver(Driver):
|
|
|
94
94
|
self.run()
|
|
95
95
|
|
|
96
96
|
def create_resume_file(self, fileset: heathrow.fileset.Fileset):
|
|
97
|
-
resume_path = self.config.config_dir / CONFIG_RESUME / (fileset.fileset_id
|
|
97
|
+
resume_path = self.config.config_dir / CONFIG_RESUME / id_to_filename(fileset.fileset_id, extension="resume")
|
|
98
98
|
download_dir = fileset
|
|
99
99
|
if resume_path.exists():
|
|
100
100
|
pass # We have it already
|
|
@@ -133,8 +133,8 @@ class HeathrowDriver(Driver):
|
|
|
133
133
|
for cliarg in self.config.targets:
|
|
134
134
|
fs = string_to_fileset(cliarg, self.config.fileset, Path(os.path.expanduser("~/Downloads")), self.config.config_dir / CONFIG_METADATA)
|
|
135
135
|
if fs is not None:
|
|
136
|
-
self.
|
|
137
|
-
|
|
136
|
+
self.create_resume_file(fs)
|
|
137
|
+
filesets.append(fs)
|
|
138
138
|
return filesets
|
|
139
139
|
|
|
140
140
|
def add_fileset(self, fileset):
|
|
@@ -195,7 +195,7 @@ class HeathrowDriver(Driver):
|
|
|
195
195
|
curses.wrapper(self.curses_main)
|
|
196
196
|
else:
|
|
197
197
|
self.init_filesets_and_economies()
|
|
198
|
-
self.
|
|
198
|
+
self._tracked_filesets_loaded = True
|
|
199
199
|
try:
|
|
200
200
|
while True:
|
|
201
201
|
time.sleep(1)
|
|
@@ -20,3 +20,8 @@ def string_to_fileset(inp: str, fileset_type: type[Fileset], download_dir: Path,
|
|
|
20
20
|
file_data = Path(inp).read_bytes()
|
|
21
21
|
fileset = fileset_type.from_file(file_data, download_dir, metadata_dir)
|
|
22
22
|
return fileset
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def id_to_filename(id_: str, extension="torrent"):
|
|
26
|
+
"""Turn a Heathrow ID to a filename."""
|
|
27
|
+
return id_.replace(":", "_") + "." + extension
|
|
@@ -10,7 +10,7 @@ from textwrap import dedent
|
|
|
10
10
|
from heathrow.fileset import MissingMetadata
|
|
11
11
|
from .base import TUIWindow
|
|
12
12
|
from ..constants import CONFIG_RESUME, CONFIG_METADATA
|
|
13
|
-
from ..util import string_to_fileset
|
|
13
|
+
from ..util import string_to_fileset, id_to_filename
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
logger = logging.getLogger(__name__)
|
|
@@ -296,10 +296,6 @@ class InfoDialogueWindow(TUIWindow):
|
|
|
296
296
|
return key != "\n"
|
|
297
297
|
|
|
298
298
|
|
|
299
|
-
def _id_to_filename(id_: str, extension="torrent"):
|
|
300
|
-
return id_.split(":", 2)[2] + "." + extension
|
|
301
|
-
|
|
302
|
-
|
|
303
299
|
class DeleteDialogueWindow(TUIWindow):
|
|
304
300
|
def __init__(self, curses_window, driver, fileset):
|
|
305
301
|
super().__init__(curses_window, driver)
|
|
@@ -351,7 +347,7 @@ class DeleteDialogueWindow(TUIWindow):
|
|
|
351
347
|
self._driver._discovery.unsubscribe(self._fileset.fileset_id)
|
|
352
348
|
except KeyError:
|
|
353
349
|
pass
|
|
354
|
-
(self._driver.config.config_dir / CONFIG_RESUME /
|
|
350
|
+
(self._driver.config.config_dir / CONFIG_RESUME / id_to_filename(self._fileset.fileset_id, extension="resume")).unlink()
|
|
355
351
|
return False
|
|
356
352
|
return True
|
|
357
353
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|