Example #1
0
def main() -> None:
    """
    The main function.

    :return: None
    """
    args = vars(parse_input())
    images = process_images(**args)
    save_copies(images, **args)
Example #2
0
def main():
    """
    The GUI main function.

    :return: None
    """
    options: dict = vars(parse_input())
    root = ImageTitlerMain(options)
    root.title(f"The Renegade Coder Image Titler {__version__}")
    root.iconphoto(False, tk.PhotoImage(file=TRC_ICON))
    root.mainloop()
    def test_tier_free(self) -> None:
        """
        Tests that the free tier is properly stored.

        :return: None
        """
        with patch.object(sys, "argv", ["image-titler", "-r", "free"]):
            args = parse_input()
            self.assertEqual(args.batch, False)
            self.assertEqual(args.path, None)
            self.assertEqual(args.tier, "free")
            self.assertEqual(args.output_path, None)
            self.assertEqual(args.logo_path, None)
            self.assertEqual(args.title, None)
    def test_batch(self) -> None:
        """
        Tests that the batch setting is properly set to True.

        :return: None
        """
        with patch.object(sys, "argv", ["image-titler", "-b"]):
            args = parse_input()
            self.assertEqual(args.batch, True)
            self.assertEqual(args.path, None)
            self.assertEqual(args.tier, None)
            self.assertEqual(args.output_path, None)
            self.assertEqual(args.logo_path, None)
            self.assertEqual(args.title, None)
    def test_logo_path(self) -> None:
        """
        Tests that the logo path is properly stored.

        :return: None
        """
        with patch.object(sys, "argv", ["image-titler", "-l", "path/to/stuff"]):
            args = parse_input()
            self.assertEqual(args.batch, False)
            self.assertEqual(args.path, None)
            self.assertEqual(args.tier, None)
            self.assertEqual(args.output_path, None)
            self.assertEqual(args.logo_path, "path/to/stuff")
            self.assertEqual(args.title, None)
    def test_default(self) -> None:
        """
        Tests that all the defaults are in a falsey state.

        :return: None
        """
        with patch.object(sys, "argv", ["image-titler"]):
            args = parse_input()
            self.assertEqual(args.batch, False)
            self.assertEqual(args.path, None)
            self.assertEqual(args.tier, None)
            self.assertEqual(args.output_path, None)
            self.assertEqual(args.logo_path, None)
            self.assertEqual(args.title, None)