Skip to content

Commit 2259a39

Browse files
REFACTOR: Minor changes in Python Projects Comments
1 parent 78029ae commit 2259a39

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

Audio Track Remover/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def process_videos_in_directory():
353353
for full_path in video_files:
354354
# Update progress bar description with current file
355355
filename = os.path.basename(full_path)
356-
pbar.set_description(f"Processing: {filename[:50]}") # Limit filename length
356+
pbar.set_description(f"Processing: {filename[:50]}") # Limit filename length
357357
remove_other_audio_tracks(full_path, pbar) # Remove non-default audio tracks
358358
pbar.update(1) # Update progress bar
359359
else:

Commits List Between Tags Generator/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# Execution Constant:
1111
REPO_URL = "https://github.com/BrenoFariasdaSilva/DDoS-Detector" # The URL of the GitHub repository
12-
SPLIT_ALL = True # If both tags are empty and SPLIT_ALL == True, split by all tags instead of single run
12+
SPLIT_ALL = True # If both tags are empty and SPLIT_ALL == True, split by all tags instead of single run
1313

1414
# Filepaths Constants:
1515
START_PATH = os.getcwd() # Get the current working directory

MP3 Timestamps Splitter/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def install_ffmpeg_windows():
6363
:return: None
6464
"""
6565

66-
verbose_output(f"{BackgroundColors.GREEN}Checking for Chocolatey...{Style.RESET_ALL}") # Output the verbose message
66+
verbose_output(f"{BackgroundColors.GREEN}Checking for Chocolatey...{Style.RESET_ALL}") # Output the verbose message
6767

6868
choco_installed = subprocess.run(["choco", "--version"], capture_output=True, text=True).returncode == 0 # Check if Chocolatey is installed
6969

@@ -109,7 +109,7 @@ def install_ffmpeg_mac():
109109
:return: None
110110
"""
111111

112-
verbose_output(f"{BackgroundColors.GREEN}Installing FFmpeg on macOS...{Style.RESET_ALL}") # Output the verbose message
112+
verbose_output(f"{BackgroundColors.GREEN}Installing FFmpeg on macOS...{Style.RESET_ALL}") # Output the verbose message
113113

114114
try: # Try installing FFmpeg
115115
subprocess.run(["brew", "install", "ffmpeg"], check=True) # Run the installation command
@@ -127,7 +127,7 @@ def check_and_install_ffmpeg():
127127
INSTALL_COMMANDS = { # Installation commands for different platforms
128128
"Windows": install_ffmpeg_windows, # Windows
129129
"Linux": install_ffmpeg_linux, # Linux
130-
"Darwin": install_ffmpeg_mac # macOS
130+
"Darwin": install_ffmpeg_mac # macOS
131131
}
132132

133133
if is_ffmpeg_installed(): # If FFmpeg is already installed

Monopoly GO/Tycoon Racers/main.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import atexit # For playing a sound when the program finishes
2-
import os # For running a command in the terminal
3-
import platform # For getting the operating system name
4-
from colorama import init, Fore, Style # For coloring the terminal
5-
from itertools import permutations # For generating permutations of team positions
1+
import atexit # For playing a sound when the program finishes
2+
import os # For running a command in the terminal
3+
import platform # For getting the operating system name
4+
from colorama import init, Fore, Style # For coloring the terminal
5+
from itertools import permutations # For generating permutations of team positions
66

77
# Initialize colorama
8-
init(autoreset=True) # Autoreset colors after each print
8+
init(autoreset=True) # Autoreset colors after each print
99

1010
# Macros:
11-
class BackgroundColors: # Colors for the terminal
11+
class BackgroundColors: # Colors for the terminal
1212
CYAN = "\033[96m" # Cyan
1313
GREEN = "\033[92m" # Green
1414
YELLOW = "\033[93m" # Yellow
@@ -18,8 +18,8 @@ class BackgroundColors: # Colors for the terminal
1818
CLEAR_TERMINAL = "\033[H\033[J" # Clear the terminal
1919

2020
# Sound Constants:
21-
SOUND_COMMANDS = {"Darwin": "afplay", "Linux": "aplay", "Windows": "start"} # The commands to play a sound for each operating system
22-
SOUND_FILE = "./.assets/Sounds/NotificationSound.wav" # The path to the sound file
21+
SOUND_COMMANDS = {"Darwin": "afplay", "Linux": "aplay", "Windows": "start"} # The commands to play a sound for each operating system
22+
SOUND_FILE = "./.assets/Sounds/NotificationSound.wav" # The path to the sound file
2323

2424
def play_sound():
2525
"""
@@ -29,20 +29,20 @@ def play_sound():
2929
"""
3030

3131
if os.path.exists(SOUND_FILE):
32-
if platform.system() in SOUND_COMMANDS: # If the platform.system() is in the SOUND_COMMANDS dictionary
32+
if platform.system() in SOUND_COMMANDS: # If the platform.system() is in the SOUND_COMMANDS dictionary
3333
os.system(f"{SOUND_COMMANDS[platform.system()]} {SOUND_FILE}")
34-
else: # If the platform.system() is not in the SOUND_COMMANDS dictionary
34+
else: # If the platform.system() is not in the SOUND_COMMANDS dictionary
3535
print(f"{BackgroundColors.RED}The {BackgroundColors.CYAN}platform.system(){BackgroundColors.RED} is not in the {BackgroundColors.CYAN}SOUND_COMMANDS dictionary{BackgroundColors.RED}. Please add it!{Style.RESET_ALL}")
36-
else: # If the sound file does not exist
36+
else: # If the sound file does not exist
3737
print(f"{BackgroundColors.RED}Sound file {BackgroundColors.CYAN}{SOUND_FILE}{BackgroundColors.RED} not found. Make sure the file exists.{Style.RESET_ALL}")
3838

3939
# Register the function to play a sound when the program finishes
4040
atexit.register(play_sound)
4141

4242
# Function to calculate total points based on race results
4343
def calculate_total_points(initial_points, race2_positions, race3_positions):
44-
normal_points = [10, 8, 7, 5] # Points for normal races
45-
double_points = [2 * points for points in normal_points] # Points for double points race
44+
normal_points = [10, 8, 7, 5] # Points for normal races
45+
double_points = [2 * points for points in normal_points] # Points for double points race
4646
total_points = initial_points.copy()
4747

4848
# Add points from race 2
@@ -165,4 +165,4 @@ def main():
165165
:return: None
166166
"""
167167

168-
main() # Call the main function
168+
main() # Call the main function

Path Content Scanner/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def is_hidden_or_system(filepath):
7575
try: # Try to get the file attributes
7676
import ctypes # Import ctypes for Windows API calls
7777
attrs = ctypes.windll.kernel32.GetFileAttributesW(str(filepath)) # Get the file attributes
78-
return bool(attrs & 2 or attrs & 4) # FILE_ATTRIBUTE_HIDDEN or SYSTEM
78+
return bool(attrs & 2 or attrs & 4) # FILE_ATTRIBUTE_HIDDEN or SYSTEM
7979
except Exception: # If an error occurs while getting the file attributes
8080
return False # Return False indicating the file is not hidden/system
8181

@@ -229,7 +229,7 @@ def perform_zero_fill_on_raw_device(raw_device):
229229

230230
try: # Try to open the raw device in binary read/write mode
231231
with open(raw_device, "rb+") as f: # Open the raw device in binary read/write mode
232-
block_size = 1024 * 1024 # 1 MB block size
232+
block_size = 1024 * 1024 # 1 MB block size
233233
zero_block = b"\x00" * block_size # Create a block of zero bytes
234234
total_written = 0 # Total bytes written
235235

0 commit comments

Comments
 (0)