Skip to content

Commit

Permalink
3.6.3
Browse files Browse the repository at this point in the history
- now supports NO_COLOR
- https://no-color.org/
  • Loading branch information
SirDank committed Jul 29, 2024
1 parent defba50 commit 0e33d80
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 24 deletions.
77 changes: 55 additions & 22 deletions dankware/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
###################################################################################

# https://github.com/SirDank

###################################################################################
# https://github.com/SirDank/dankware

import os
from .traceback import err
from .datetime import get_duration
from .requests import github_downloads, github_file_selector
Expand All @@ -28,14 +25,14 @@

# ---

black_dim = Style.DIM + Fore.BLACK
blue_dim = Style.DIM + Fore.BLUE
cyan_dim = Style.DIM + Fore.CYAN
green_dim = Style.DIM + Fore.GREEN
magenta_dim = Style.DIM + Fore.MAGENTA
red_dim = Style.DIM + Fore.RED
white_dim = Style.DIM + Fore.WHITE
yellow_dim = Style.DIM + Fore.YELLOW
black_bright = Style.BRIGHT + Fore.BLACK
blue_bright = Style.BRIGHT + Fore.BLUE
cyan_bright = Style.BRIGHT + Fore.CYAN
green_bright = Style.BRIGHT + Fore.GREEN
magenta_bright = Style.BRIGHT + Fore.MAGENTA
red_bright = Style.BRIGHT + Fore.RED
white_bright = Style.BRIGHT + Fore.WHITE
yellow_bright = Style.BRIGHT + Fore.YELLOW

# ---

Expand All @@ -50,21 +47,57 @@

# ---

black_bright = Style.BRIGHT + Fore.BLACK
blue_bright = Style.BRIGHT + Fore.BLUE
cyan_bright = Style.BRIGHT + Fore.CYAN
green_bright = Style.BRIGHT + Fore.GREEN
magenta_bright = Style.BRIGHT + Fore.MAGENTA
red_bright = Style.BRIGHT + Fore.RED
white_bright = Style.BRIGHT + Fore.WHITE
yellow_bright = Style.BRIGHT + Fore.YELLOW
black_dim = Style.DIM + Fore.BLACK
blue_dim = Style.DIM + Fore.BLUE
cyan_dim = Style.DIM + Fore.CYAN
green_dim = Style.DIM + Fore.GREEN
magenta_dim = Style.DIM + Fore.MAGENTA
red_dim = Style.DIM + Fore.RED
white_dim = Style.DIM + Fore.WHITE
yellow_dim = Style.DIM + Fore.YELLOW

# https://no-color.org/

if 'NO_COLOR' in os.environ:
reset = ''
black = ''
blue = ''
cyan = ''
green = ''
magenta = ''
red = ''
white = ''
yellow = ''
black_bright = ''
blue_bright = ''
cyan_bright = ''
green_bright = ''
magenta_bright = ''
red_bright = ''
white_bright = ''
yellow_bright = ''
black_normal = ''
blue_normal = ''
cyan_normal = ''
green_normal = ''
magenta_normal = ''
red_normal = ''
white_normal = ''
yellow_normal = ''
black_dim = ''
blue_dim = ''
cyan_dim = ''
green_dim = ''
magenta_dim = ''
red_dim = ''
white_dim = ''
yellow_dim = ''

from .text import clr, align, fade, random_ip
from .terminal import cls, title, rm_line, sys_open
from .multithread import multithread
#from .pillow import splash_screen
from .winreg import get_path

import os
if os.name == 'nt':
from .winreg import export_registry_keys
2 changes: 2 additions & 0 deletions dankware/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def github_downloads(user_repo: str) -> tuple[str]:
```
"""

# [NOTE] needs to be updated to not use api. Example: https://github.com/EssentialsX/Essentials/releases/expanded_assets/2.20.1

response = requests.get(f"https://api.github.com/repos/{user_repo}/releases/latest", headers = {"User-Agent": "dankware"}, timeout=3)

if response.status_code == 200:
Expand Down
2 changes: 1 addition & 1 deletion dankware/winreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_path(location: str) -> str:

"""
Returns path from registry
- Supports: Desktop / Documents / Favorites / Pictures / Videos / Music
- Supports: AppData / Desktop / Documents / Favorites / Pictures / Videos / Music
"""

if os.name == 'nt':
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

license = "MIT",
name = "dankware",
version = "3.6.2",
version = "3.6.3",
author = "SirDank",

author_email = "[email protected]",
Expand Down

0 comments on commit 0e33d80

Please sign in to comment.