From 1c71872ca7f5a412dc90495d177bdc6bac7d3815 Mon Sep 17 00:00:00 2001 From: SirDank <52797753+SirDank@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:34:52 +0530 Subject: [PATCH] 3.6.4 --- README.md | 74 ++++++++++++++++++++++++++++++++++++-------- dankware/__init__.py | 8 ++--- dankware/ctypes.py | 5 ++- setup.py | 2 +- 4 files changed, 68 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f824136..661b6a4 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,25 @@

# 🚨 dankware 🚨 + Python module with various features! Install with the below command! -``` + +```bash pip install dankware ``` -Update to the latest version with the below command! +```bash +pip install dankware[extras] ``` + +Update to the latest version with the below command! + +```bash pip install --upgrade dankware ``` - + # 🚨 Multithreading 🚨 + ```py from dankware import multithread import time @@ -36,6 +44,7 @@ def example(): multithread(example, 10) # func: example | threads: 10 | single: 50 seconds | multi: 5 seconds ``` + image
```py @@ -53,6 +62,7 @@ def example(num): multithread(example, 10, new_list) # input_one: list print(sum) ``` + image
```py @@ -68,6 +78,7 @@ def example(num1, num2): multithread(example, 10, list1, list2) # input_one: list1 | input_two: list2 ``` + image
```py @@ -82,9 +93,10 @@ def example(num1, num2): multithread(example, 10, new_list, 5, progress_bar=False) # input_two: 5 | disabled progress bar ``` + image
-

 

+

 

--- @@ -103,10 +115,11 @@ registry_path = r'Software\Google\Chrome\PreferenceMACs' export_registry_keys(registry_root, registry_path, recursive=True, export_path=export_path) ``` + image image
-

 

+

 

--- @@ -142,10 +155,11 @@ except: print(clr(err(sys.exc_info()),2)) try: value = 1/0 except: print(clr(err(sys.exc_info(),"mini"),2)) ``` + image
image
-

 

+

 

--- @@ -156,6 +170,7 @@ from dankware import github_downloads # full url > https://api.github.com/repos/EssentialsX/Essentials/releases/latest for url in github_downloads("EssentialsX/Essentials"): print(url) ``` + image
```py @@ -163,9 +178,10 @@ from dankware import github_file_selector # full url > https://api.github.com/repos/EssentialsX/Essentials/releases/latest for url in github_file_selector("EssentialsX/Essentials", "remove", ('AntiBuild', 'Discord', 'GeoIP', 'Protect', 'XMPP')): print(url) ``` + image
-

 

+

 

--- @@ -175,9 +191,10 @@ for url in github_file_selector("EssentialsX/Essentials", "remove", ('AntiBuild' from dankware import random_ip print(random_ip()) ``` + image
-

 

+

 

--- @@ -209,9 +226,10 @@ for location in locations: path = get_path(location) print(path) ``` + image
-

 

+

 

--- @@ -225,6 +243,7 @@ from dankware import clr print(clr("\n > Hey! Long time no see :)")) #print(clr("\n > Hey! Long time no see :)", colour_one = white_bright, colour_two = red_bright)) ``` + image
```py @@ -234,12 +253,14 @@ from dankware import clr, white, magenta # colour_two = white print(clr("\n > Hey! Long time no see :)", colour_one = magenta, colour_two = white)) ``` + image
```py from dankware import clr print(clr("\n This is a string: True | This is an integer: False")) ``` + image
```py @@ -248,6 +269,7 @@ from dankware import clr, green, magenta, white # colour_two = green print(clr(f"\n > {magenta}Purple{white} thinks he's better than everyone else :(", colour_two=green)) ``` + image
```py @@ -255,6 +277,7 @@ from dankware import clr # preset = 2 print(clr("\n > Error in sector [7] redirecting... | INTEGRITY_CHECK: SUCCESS",2)) ``` + image
```py @@ -262,6 +285,7 @@ from dankware import clr # preset = 3 print(clr("\n > Is this a randomly coloured string: TRUE | As you can see it does not colour True/False",3)) ``` + image
```py @@ -269,9 +293,10 @@ from dankware import clr, white, white_normal, white_dim, red, red_normal, red_d # preset = 3 print(clr("\n > This is a randomly coloured string based on the input colours!",3,colours=(white_bright, white_normal, white_dim, red_bright, red_normal, red_dim))) ``` + image
-

 

+

 

--- @@ -293,28 +318,34 @@ Y88b 888 888 888 888 888 888 "88b Y88b 888 d88P 888 888 888 Y8b. ``` ## ♦️ Colourize Banner (random) ♦️ + ```py from dankware import clr # preset = 4 print(clr(banner,4)) ``` + image
## ♦️ Align Banner (console center) ♦️ + ```py from dankware import align print(align(banner)) # also works with single text line (even coloured) ``` + image
## ♦️ Align Coloured Banner ♦️ + ```py from dankware import align, clr print(clr(align(banner),4)) # OR (preferably not) print(align(clr(banner,4))) ``` + image
-

 

+

 

--- @@ -341,95 +372,112 @@ Y8b d88P ``` ## ♦️ Black To White ♦️ + ```py print(fade(banner, "black2white")) print(fade(banner, "black2white-v")) ``` +

image image

## ♦️ Yellow To Red ♦️ + ```py print(fade(banner, "yellow2red")) print(fade(banner, "yellow2red-v")) ``` +

image image

## ♦️ Green To Yellow ♦️ + ```py print(fade(banner, "green2yellow")) print(fade(banner, "green2yellow-v")) ``` +

image image

## ♦️ Green To Cyan ♦️ + ```py print(fade(banner, "green2cyan")) print(fade(banner, "green2cyan-v")) ``` +

image image

## ♦️ Blue To Cyan ♦️ + ```py print(fade(banner, "blue2cyan")) print(fade(banner, "blue2cyan-v")) ``` +

image image

## ♦️ Blue To Pink ♦️ + ```py print(fade(banner, "blue2pink")) print(fade(banner, "blue2pink-v")) ``` +

image image

## ♦️ Pink To Red ♦️ + ```py print(fade(banner, "pink2red")) print(fade(banner, "pink2red-v")) ``` +

image image

## ♦️ Random ♦️ + ```py print(fade(banner, "random")) ``` +

image

-

 

+

 

--- # 🚨 Also check out 🚨 +

image

-

 

+

 

--- diff --git a/dankware/__init__.py b/dankware/__init__.py index e43dbac..ab83fb4 100644 --- a/dankware/__init__.py +++ b/dankware/__init__.py @@ -93,11 +93,11 @@ 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 .text import clr, align, fade, random_ip # pylint: disable=wrong-import-position # noqa: E402 +from .terminal import cls, title, rm_line, sys_open # pylint: disable=wrong-import-position # noqa: E402 +from .multithread import multithread # pylint: disable=wrong-import-position # noqa: E402 #from .pillow import splash_screen -from .winreg import get_path +from .winreg import get_path # pylint: disable=wrong-import-position # noqa: E402 if os.name == 'nt': from .winreg import export_registry_keys diff --git a/dankware/ctypes.py b/dankware/ctypes.py index 5189dad..119cad1 100644 --- a/dankware/ctypes.py +++ b/dankware/ctypes.py @@ -4,8 +4,6 @@ if os.name == 'nt': import ctypes -elif os.name == 'posix': - import pwd # pylint: disable=import-error def is_admin() -> bool: @@ -17,7 +15,8 @@ def is_admin() -> bool: try: return ctypes.windll.shell32.IsUserAnAdmin() except: return False elif os.name == 'posix': - return pwd.getpwuid(os.getuid())[0] in ('root', '0') # pylint: disable=no-member + from pwd import getpwuid # pylint: disable=import-error, import-outside-toplevel + return getpwuid(os.getuid())[0] in ('root', '0') # pylint: disable=no-member else: raise ValueError(f"Unsupported Operating System: {os.name} | Supported: 'nt', 'posix'") diff --git a/setup.py b/setup.py index 56a832a..d1f6486 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ license = "MIT", name = "dankware", - version = "3.6.3", + version = "3.6.4", author = "SirDank", author_email = "SirDankenstein@protonmail.com",