diff --git a/Makefile b/Makefile index f3ca409..e231b41 100644 --- a/Makefile +++ b/Makefile @@ -78,17 +78,13 @@ lint: ## run linters on codebase prospector torrentfileQt prospector tests -coverage: ## run coverage on project - pytest tests --cov=torrentfileQt --cov tests - coverage report - coverage xml -o coverage.xml - bash codacy.sh report -r coverage.xml - test: ## run tests quickly with the default Python pip install --upgrade --force-reinstall --no-cache -rrequirements.txt pytest tests --cov=torrentfileQt --cov=tests + coverage report + coverage xml -o coverage.xml -push: clean lint coverage test ## push changes to remote +push: clean lint test ## push changes to remote git add . git commit -m "$m" git push diff --git a/coverage.xml b/coverage.xml index f90a6ea..250aa2e 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,5 +1,5 @@ - + @@ -158,8 +158,8 @@ - - + + @@ -169,8 +169,8 @@ - - + + @@ -189,9 +189,9 @@ - - - + + + @@ -203,7 +203,7 @@ - + @@ -212,14 +212,15 @@ - - + + + @@ -1177,104 +1178,108 @@ + - - + + - + - + + - + - - - + - - - - + + + + + - + + - - - + - + + + + - - - - + - + + - + + - - - + - + + + + - - - - + + - + - - + + - + + - - + - + + + + @@ -1429,9 +1434,9 @@ + - - + @@ -1445,36 +1450,36 @@ + - + - - + + - - - + + + - + - + - @@ -1489,13 +1494,15 @@ + - + - + + diff --git a/package.json b/package.json index f059af1..750143a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "torrentfileqt", "displayName": "TorrentfileQt", - "version": "0.3.2", + "version": "0.3.3", "description": "GUI torrentfile creator.", "repository": { "type": "git", diff --git a/requirements.txt b/requirements.txt index ca1af89..e13b980 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ wheel setuptools -torrentfile==0.7.0 +torrentfile==0.7.6 PySide6 pyben diff --git a/tests/__init__.py b/tests/__init__.py index 9a6802c..47418ab 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -28,7 +28,7 @@ from pathlib import Path import pytest -from torrentfile import TorrentFile, TorrentFileHybrid, TorrentFileV2 +from torrentfile.torrent import TorrentFile, TorrentFileHybrid, TorrentFileV2 from torrentfileQt import alt_start diff --git a/tests/test_checktab.py b/tests/test_checktab.py index 791caef..c3a8488 100644 --- a/tests/test_checktab.py +++ b/tests/test_checktab.py @@ -164,6 +164,6 @@ def test_singlefile(size, ext, index, version, wind): checktab.fileInput.setText(metafile) checktab.searchInput.setText(tfile) checktab.checkButton.click() - ptext = checktab.textEdit.toPlainText() - assert "100%" in ptext + widges = checktab.treeWidget.itemWidgets + assert all(i.total == i.value for i in widges.values()) rmpath(tfile, metafile) diff --git a/tests/test_createTab.py b/tests/test_createTab.py index ea8e58c..b7397a3 100644 --- a/tests/test_createTab.py +++ b/tests/test_createTab.py @@ -46,6 +46,7 @@ def test_create_with_hasher1(dir2, wind): creator.path_input.clear() creator.path_input.setText(dir2) creator.output_input.clear() + creator.web_seed_input.setPlainText("url1") creator.output_input.setText(metafile) creator.v1button.setChecked(True) creator.piece_length.setCurrentIndex(2) diff --git a/tests/test_infotab.py b/tests/test_infotab.py index 515dc37..1d8cde4 100644 --- a/tests/test_infotab.py +++ b/tests/test_infotab.py @@ -19,7 +19,7 @@ """Testing module for most of GUI.""" import pytest -from torrentfile import TorrentFile, TorrentFileHybrid, TorrentFileV2 +from torrentfile.torrent import TorrentFile, TorrentFileHybrid, TorrentFileV2 from tests import dir2, dir3, rmpath, tempfile, ttorrent, wind, MockEvent diff --git a/tests/test_magnettab.py b/tests/test_magnettab.py index 60da1c6..996f755 100644 --- a/tests/test_magnettab.py +++ b/tests/test_magnettab.py @@ -19,7 +19,7 @@ """Testing module for most of GUI.""" import pytest -from torrentfile import TorrentFile +from torrentfile.torrent import TorrentFile from torrentfile import magnet from tests import dir1, rmpath, tempfile, wind, MockEvent, ttorrent, dir2 diff --git a/torrentfileQt/createTab.py b/torrentfileQt/createTab.py index 505ecf2..52dbb2c 100644 --- a/torrentfileQt/createTab.py +++ b/torrentfileQt/createTab.py @@ -31,7 +31,7 @@ QHBoxLayout, QLabel, QLineEdit, QPlainTextEdit, QPushButton, QRadioButton, QSpacerItem, QToolButton, QWidget) -from torrentfile import TorrentFile, TorrentFileHybrid, TorrentFileV2 +from torrentfile.torrent import TorrentFile, TorrentFileHybrid, TorrentFileV2 from torrentfile.utils import path_piece_length from torrentfileQt.qss import pushButtonEdit @@ -228,6 +228,11 @@ def submit(self): if announce: args["announce"] = announce + url_list = self.widget.web_seed_input.toPlainText() + url_list = [i for i in url_list.split('\n') if i] + if url_list: + args['url_list'] = url_list + # Calculates piece length if not specified by user. outtext = os.path.realpath(self.widget.output_input.text()) if outtext: diff --git a/torrentfileQt/editorTab.py b/torrentfileQt/editorTab.py index dab68da..eb5e8d4 100644 --- a/torrentfileQt/editorTab.py +++ b/torrentfileQt/editorTab.py @@ -228,6 +228,8 @@ def __init__(self, parent=None): def clear(self): """Remove any data previously added to table.""" self.info = {} + for row in range(self.rowCount()): + self.removeRow(row) self.setRowCount(0) super().clear() diff --git a/torrentfileQt/version.py b/torrentfileQt/version.py index d642860..a50cef1 100644 --- a/torrentfileQt/version.py +++ b/torrentfileQt/version.py @@ -30,4 +30,4 @@ def _conf(): ASSETS = str(_conf()) os.environ['ASSETS'] = ASSETS -__version__ = "0.3.2" +__version__ = "0.3.3"