From 1641b82def435debb977802c491cbd65d72dd2c7 Mon Sep 17 00:00:00 2001 From: Zaeem20 Date: Sun, 31 Oct 2021 21:39:03 +0530 Subject: [PATCH] added encodings --- webeye/__init__.py | 1 - webeye/core.py | 6 +++--- webeye/{encryptions => }/rot.py | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) rename webeye/{encryptions => }/rot.py (98%) diff --git a/webeye/__init__.py b/webeye/__init__.py index c45f35c..468e954 100644 --- a/webeye/__init__.py +++ b/webeye/__init__.py @@ -1,5 +1,4 @@ from .core import * -from .encryptions import * __name__ = "webeye" __version__ = "2.2.7" diff --git a/webeye/core.py b/webeye/core.py index e35813e..67289d0 100644 --- a/webeye/core.py +++ b/webeye/core.py @@ -11,7 +11,7 @@ from datetime import datetime from bs4 import BeautifulSoup from collections.abc import Iterable -import encryptions.rot +from webeye.rot import encoding from typing import Union from concurrent.futures import ThreadPoolExecutor @@ -216,7 +216,7 @@ def encode(text: str, rot: int=0): return text.upper() else: letters = string.ascii_uppercase + string.ascii_lowercase - _rot = encryptions.rot.encoding[f'rot-{str(rot)}'] + _rot = encoding[f'rot-{str(rot)}'] rot = text.maketrans(letters, _rot) return text.translate(rot) @@ -232,7 +232,7 @@ def decode(text: str, rot: int) -> str: return text.upper() else: letters = string.ascii_uppercase + string.ascii_lowercase - _rot = encryptions.rot.encoding[f'rot-{str(rot)}'] + _rot = encoding[f'rot-{str(rot)}'] rot = text.maketrans(_rot, letters) return text.translate(rot) diff --git a/webeye/encryptions/rot.py b/webeye/rot.py similarity index 98% rename from webeye/encryptions/rot.py rename to webeye/rot.py index ef04f65..e3803f9 100644 --- a/webeye/encryptions/rot.py +++ b/webeye/rot.py @@ -1,4 +1,3 @@ -__all__ = ['encoding'] encoding ={ "rot-0": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",