Commit 6c0a469b authored by Hermann Krumrey's avatar Hermann Krumrey

Fix unit tests failing with nose

parent adea943d
......@@ -17,8 +17,6 @@ You should have received a copy of the GNU General Public License
along with toktokkie. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
from toktokkie.Directory import Directory
sentry_dsn = "https://77992bd58d9a46fc812ad491ba460a7e@sentry.namibsun.net/10"
"""
......
......@@ -23,7 +23,7 @@ import time
from threading import Thread
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QMainWindow, QFileDialog, QTreeWidgetItem, QWidget
from toktokkie import Directory
from toktokkie.Directory import Directory
from toktokkie.exceptions import MissingMetadata, InvalidMetadata
from toktokkie.metadata.components.enums import MediaType
from toktokkie.gui.pyuic.main import Ui_MainWindow
......
"""LICENSE
Copyright 2019 Hermann Krumrey <hermann@krumreyh.com>
This file is part of toktokkie.
toktokkie is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
toktokkie is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with toktokkie. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
from PyQt5.QtWidgets import QDialog, QMainWindow, QListWidgetItem
from toktokkie.gui.pyuic.remove_directory_dialog import \
Ui_RemoveDirectoryDialog
class RemoveDirectoryDialog(QDialog, Ui_RemoveDirectoryDialog):
"""
Class that models a dialog that allows a user to remove a directory
from the config file
"""
def __init__(self, parent: QMainWindow):
"""
Initializes the widget
:param parent: The parent window
"""
super().__init__(parent)
self.setupUi(self)
self.remove_button.clicked.connect(self.remove_selected)
media_dirs = self.parent().config["media_directories"]
for path in media_dirs:
self.directory_list.addItem(QListWidgetItem(path))
def remove_selected(self):
"""
Removes the selected directories from the config and
closes the dialog afterwards
:return: None
"""
selected = self.directory_list.selectedItems()
for item in selected:
self.parent().config["media_directories"].remove(item.text())
self.parent().write_config()
self.parent().reload()
self.close()
"""LICENSE
Copyright 2019 Hermann Krumrey <hermann@krumreyh.com>
This file is part of toktokkie.
toktokkie is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
toktokkie is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with toktokkie. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
......@@ -20,7 +20,7 @@ LICENSE"""
import argparse
import logging
from typing import List, Optional
from toktokkie import Directory
from toktokkie.Directory import Directory
from toktokkie.exceptions import MissingMetadata, InvalidMetadata
from toktokkie.metadata.components.enums import MediaType
......
......@@ -20,7 +20,7 @@ LICENSE"""
import os
import argparse
import requests
from toktokkie import Directory
from toktokkie.Directory import Directory
from puffotter.graphql import GraphQlClient
from puffotter.os import makedirs
from subprocess import Popen
......
......@@ -26,7 +26,7 @@ from manga_dl.scrapers.mangadex import MangaDexScraper
from manga_dl.entities.Chapter import Chapter
from puffotter.os import makedirs, listdir, replace_illegal_ntfs_chars
from puffotter.print import pprint
from toktokkie import Directory
from toktokkie.Directory import Directory
from toktokkie.scripts.Command import Command
from toktokkie.renaming.Renamer import Renamer
from zipfile import ZipFile
......
......@@ -19,7 +19,7 @@ LICENSE"""
import os
import argparse
from toktokkie import Directory
from toktokkie.Directory import Directory
from toktokkie.metadata.components.enums import MediaType
from toktokkie.scripts.Command import Command
......
......@@ -45,7 +45,9 @@ class MetadataSetCommand(Command):
id_types = [x.value for x in IdType]
subparser = parser.add_subparsers(dest="mode", required=True)
subparser = parser.add_subparsers(
dest="mode", required=True
) # type: ignore
multi_episode_parser = subparser.add_parser(
"multi-episode", help="Add a multi-episode to a TV Series"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment