Skip to content

Commit

Permalink
added encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaeem20 committed Oct 31, 2021
1 parent 6eb2a86 commit 1641b82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion webeye/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from .core import *
from .encryptions import *

__name__ = "webeye"
__version__ = "2.2.7"
Expand Down
6 changes: 3 additions & 3 deletions webeye/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down
1 change: 0 additions & 1 deletion webeye/encryptions/rot.py → webeye/rot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
__all__ = ['encoding']

encoding ={
"rot-0": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
Expand Down

0 comments on commit 1641b82

Please sign in to comment.