Skip to content

Commit 622c482

Browse files
Updated for linting
1 parent ab9eaf4 commit 622c482

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# This contains the main code
1+
"""
2+
The module for creating a loading bar in the terminal using emojis.
3+
"""
4+
5+
import warnings
26

37
# These are just for the nice terminal colour
48
GREEN = "\033[32m"
59
RED = "\033[31m"
610

711
RESET = "\033[0m" # Resets to default terminal color
812

9-
import warnings
10-
import time
11-
1213

1314
class LoadingBar:
1415
"""A basic loading bar for the terminal.
@@ -18,20 +19,20 @@ class LoadingBar:
1819
on_emoji(str) : The emoji sr string to show a completed part of the bar
1920
off_emoji(str) : The emoji to show a non-completed part of the bar
2021
capacity(int) : The total length of the bar
21-
isPercentage(bool) : True if the status shoudl be represented in percentage format, else in fraction format
22+
isPercentage(bool) : True if the status should be represented in percentage format, else in fraction format
2223
"""
2324

2425
def __init__(
2526
self,
2627
capacity: int,
2728
on_emoji: str = "█",
2829
off_emoji: str = "▒",
29-
isPercentage: bool = False,
30+
is_percentage: bool = False,
3031
):
3132
self.on_emoji = on_emoji
3233
self.off_emoji = off_emoji
3334
self.capacity = capacity
34-
self.isPercentage = isPercentage
35+
self.is_percentage = is_percentage
3536
self.value = 0
3637

3738
def incrememt_bar(self, prefix: str = "", suffix: str = "", display_status=True):
@@ -58,7 +59,7 @@ def incrememt_bar(self, prefix: str = "", suffix: str = "", display_status=True)
5859
else:
5960
output = output + self.off_emoji
6061

61-
if self.isPercentage:
62+
if self.is_percentage:
6263
status = round(self.value / self.capacity * 100)
6364
if not self.value >= self.capacity:
6465
print(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "emoji_bars"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
description = "A Python module for creating emoji-based progress bars."
55
authors = [
66
{ name = "Mathdallas", email = "jaimorampudi164@gmail.com" }

tests/test_loading_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from emoji_bars.loadingBar import LoadingBar
21
import time
2+
from emoji_bars.loading_bar import LoadingBar
33

44
testBar = LoadingBar(10)
55
for i in range(0, testBar.capacity):

0 commit comments

Comments
 (0)