From 12cf076118570eebbff08c6b3090e0d4798447a1 Mon Sep 17 00:00:00 2001 From: cyfraeviolae Date: Wed, 3 Apr 2024 03:17:55 -0400 Subject: no venv --- .../jsbeautifier/unpackers/urlencode.py | 36 ---------------------- 1 file changed, 36 deletions(-) delete mode 100644 venv/lib/python3.11/site-packages/jsbeautifier/unpackers/urlencode.py (limited to 'venv/lib/python3.11/site-packages/jsbeautifier/unpackers/urlencode.py') diff --git a/venv/lib/python3.11/site-packages/jsbeautifier/unpackers/urlencode.py b/venv/lib/python3.11/site-packages/jsbeautifier/unpackers/urlencode.py deleted file mode 100644 index d0d492a..0000000 --- a/venv/lib/python3.11/site-packages/jsbeautifier/unpackers/urlencode.py +++ /dev/null @@ -1,36 +0,0 @@ -# -# Trivial bookmarklet/escaped script detector for the javascript beautifier -# written by Einar Lielmanis -# rewritten in Python by Stefano Sanfilippo -# -# Will always return valid javascript: if `detect()` is false, `code` is -# returned, unmodified. -# -# usage: -# -# some_string = urlencode.unpack(some_string) -# - -"""Bookmarklet/escaped script unpacker.""" - -# Python 2 retrocompatibility -# pylint: disable=F0401 -# pylint: disable=E0611 -try: - from urllib import unquote_plus -except ImportError: - from urllib.parse import unquote_plus - -PRIORITY = 0 - - -def detect(code): - """Detects if a scriptlet is urlencoded.""" - # the fact that script doesn't contain any space, but has %20 instead - # should be sufficient check for now. - return " " not in code and ("%20" in code or code.count("%") > 3) - - -def unpack(code): - """URL decode `code` source string.""" - return unquote_plus(code) if detect(code) else code -- cgit v1.2.3