From 9fc1fdc4ee4fe8d91933f38bf43853ef2d759fbe Mon Sep 17 00:00:00 2001 From: Jarik Marwede <contact@jarikmarwede.com> Date: Thu, 24 Aug 2023 20:21:10 +0200 Subject: [PATCH 1/3] Update Python version to 3.10 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a32b02..59c3e0e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The original categories from *Idea Bag 2* are used to organize them. ## How to use If you want to get the programs for playing around with them or editing them just download or clone them from Github. -All programs need [python 3.8](https://www.python.org/downloads/) or later installed, +All programs need [python 3.10](https://www.python.org/downloads/) or later installed, and for some of them external modules are required. Go to [Dependencies](#dependencies) to check which modules you need to install and how. @@ -24,7 +24,7 @@ You can watch this video, which explains how to use this repository and how it i If you want to contribute in any way please take a look at [CONTRIBUTING.md](CONTRIBUTING.md). ## Dependencies -* [Python 3.8+](https://www.python.org/downloads/) +* [Python 3.10+](https://www.python.org/downloads/) * [Pillow](http://python-pillow.org) (Graphics and Multimedia/Dominant Colors, Threading/Bulk Thumbnail Creator) * [Beautifulsoup](https://www.crummy.com/software/BeautifulSoup/) (Web/Page Scraper) * [Pygame](https://www.pygame.org/) (Graphics and Multimedia/Mp3 Player) From bfe79a79c0d68b59ee0129a01b1be50a00f2f7ea Mon Sep 17 00:00:00 2001 From: Jarik Marwede <contact@jarikmarwede.com> Date: Thu, 24 Aug 2023 20:22:53 +0200 Subject: [PATCH 2/3] Fix some typing errors --- .../Dominant_Colors/dominant_colors.py | 2 +- .../Mp3_Player/mp3_player.pyw | 2 +- Text/CD_Key_Generator/cd_key_generator.py | 2 +- Text/Fizz_Buzz/fizz_buzz.py | 4 +- Text/RSS_Feed_Creator/rss_feed_creator.py | 52 +++++++++---------- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Graphics_and_Multimedia/Dominant_Colors/dominant_colors.py b/Graphics_and_Multimedia/Dominant_Colors/dominant_colors.py index b2a4946..ac9a688 100644 --- a/Graphics_and_Multimedia/Dominant_Colors/dominant_colors.py +++ b/Graphics_and_Multimedia/Dominant_Colors/dominant_colors.py @@ -125,7 +125,7 @@ def new_image(self): self.bands.set("".join(image.getbands())) -def load_image(image_path: str) -> Image: +def load_image(image_path: str) -> Image.Image: """Return Image object of specified image.""" image = Image.open(image_path) image.load() diff --git a/Graphics_and_Multimedia/Mp3_Player/mp3_player.pyw b/Graphics_and_Multimedia/Mp3_Player/mp3_player.pyw index 04f3ea8..7ec3ed7 100644 --- a/Graphics_and_Multimedia/Mp3_Player/mp3_player.pyw +++ b/Graphics_and_Multimedia/Mp3_Player/mp3_player.pyw @@ -255,7 +255,7 @@ class MainWindow(tk.Tk): self.treeview_frame.grid_rowconfigure(0, weight=1) self.volume_frame.grid_rowconfigure(1, weight=1) - def play_audio(self, file: tuple = None): + def play_audio(self, file: tuple | None = None): """Play the currently selected file.""" selection = self.playlist_treeview.selection() diff --git a/Text/CD_Key_Generator/cd_key_generator.py b/Text/CD_Key_Generator/cd_key_generator.py index 13353c6..4357358 100644 --- a/Text/CD_Key_Generator/cd_key_generator.py +++ b/Text/CD_Key_Generator/cd_key_generator.py @@ -21,7 +21,7 @@ import random -def generate_key(characters: tuple, length: int, file_name: str = None) -> str: +def generate_key(characters: tuple, length: int, file_name: str | None = None) -> str: """Return random string containing specified characters.""" random_result = random.choices(characters, k=length) string = "" diff --git a/Text/Fizz_Buzz/fizz_buzz.py b/Text/Fizz_Buzz/fizz_buzz.py index 8fe2f16..d232a1d 100644 --- a/Text/Fizz_Buzz/fizz_buzz.py +++ b/Text/Fizz_Buzz/fizz_buzz.py @@ -13,7 +13,7 @@ from typing import Generator -def fizzbuzz() -> list: +def fizzbuzz() -> list[str | int]: """Return Fizz Buzz from 1 to 100. Return a list of numbers from 1 to 100, @@ -21,7 +21,7 @@ def fizzbuzz() -> list: multiples of five with Buzz and multiples of both with FizzBuzz. """ - fizzbuzz_list = [] + fizzbuzz_list: list[str | int] = [] for num in range(1, 101): if num % 3 == 0 and num % 5 == 0: fizzbuzz_list.append("FizzBuzz") diff --git a/Text/RSS_Feed_Creator/rss_feed_creator.py b/Text/RSS_Feed_Creator/rss_feed_creator.py index b22eea3..2dd969f 100644 --- a/Text/RSS_Feed_Creator/rss_feed_creator.py +++ b/Text/RSS_Feed_Creator/rss_feed_creator.py @@ -19,15 +19,15 @@ class RSSItem: def __init__(self, title: str, - link: str = None, - description: str = None, - author: str = None, - category: str = None, - comments: str = None, - enclosure: dict = None, - guid: str = None, - pub_date: datetime.datetime = None, - source: str = None): + link: str | None = None, + description: str | None = None, + author: str | None = None, + category: str | None = None, + comments: str | None = None, + enclosure: dict | None = None, + guid: str | None = None, + pub_date: datetime.datetime | None = None, + source: str | None = None): self.title = title self.link = link self.description = description @@ -48,22 +48,22 @@ def __init__(self, channel_link: str, channel_description: str, items: List[RSSItem], - language: str = None, - copyright: str = None, - managing_editor: str = None, - web_master: str = None, - pub_date: datetime.datetime = None, - last_build_date: datetime.datetime = None, - category: str = None, - generator: str = None, - docs: str = None, - cloud: dict = None, - ttl: int = None, - image: dict = None, - rating: str = None, - text_input: dict = None, - skip_hours: list = None, - skip_days: list = None): + language: str | None = None, + copyright: str | None = None, + managing_editor: str | None = None, + web_master: str | None = None, + pub_date: datetime.datetime | None = None, + last_build_date: datetime.datetime | None = None, + category: str | None = None, + generator: str | None = None, + docs: str | None = None, + cloud: dict | None = None, + ttl: int | None = None, + image: dict | None = None, + rating: str | None = None, + text_input: dict | None = None, + skip_hours: list | None = None, + skip_days: list | None = None): self.channel_title = channel_title self.channel_link = channel_link self.channel_description = channel_description @@ -89,7 +89,7 @@ def __init__(self, class RSSFile: """An RSS file.""" - def __init__(self, file_name: str, rss_document: RSSDocument = None): + def __init__(self, file_name: str, rss_document: RSSDocument | None = None): self.file_name = file_name self.rss_document = rss_document From 24945fe10c436039640412175d562a9c6fd74434 Mon Sep 17 00:00:00 2001 From: Jarik Marwede <contact@jarikmarwede.com> Date: Thu, 24 Aug 2023 20:39:46 +0200 Subject: [PATCH 3/3] Fix import --- Numbers/Find_Pi_to_the_Nth_digit/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Numbers/Find_Pi_to_the_Nth_digit/tests.py b/Numbers/Find_Pi_to_the_Nth_digit/tests.py index 89d4c58..aece8f0 100644 --- a/Numbers/Find_Pi_to_the_Nth_digit/tests.py +++ b/Numbers/Find_Pi_to_the_Nth_digit/tests.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import unittest -from find_pi_to_the_nth_digit import get_pi_to +from Numbers.Find_Pi_to_the_Nth_digit.find_pi_to_the_nth_digit import get_pi_to class Test(unittest.TestCase):