From 12cf076118570eebbff08c6b3090e0d4798447a1 Mon Sep 17 00:00:00 2001 From: cyfraeviolae Date: Wed, 3 Apr 2024 03:17:55 -0400 Subject: no venv --- .../faker/providers/automotive/ar_SA/__init__.py | 89 --------------------- .../ar_SA/__pycache__/__init__.cpython-311.pyc | Bin 4101 -> 0 bytes 2 files changed, 89 deletions(-) delete mode 100644 venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__init__.py delete mode 100644 venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__pycache__/__init__.cpython-311.pyc (limited to 'venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA') diff --git a/venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__init__.py b/venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__init__.py deleted file mode 100644 index 6b7ee49..0000000 --- a/venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__init__.py +++ /dev/null @@ -1,89 +0,0 @@ -import re - -from .. import Provider as AutomotiveProvider - - -class Provider(AutomotiveProvider): - """Implement automotive provider for ``ar_SA`` locale. - - Sources: - - - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Saudi_Arabia - - .. |license_plate_en| replace:: - :meth:`license_plate_en()` - """ - - LICENSE_FORMAT_EN = "#### ???" - LICENSE_FORMAT_AR = "? ? ? ####" - - PLATE_CHARS_EN = "ABDEGHJKLNRSTUVXZ" - PLATE_CHARS_AR = "أبدعقهحكلنرسطوىصم" - - PLATE_MAP = { - "A": "ا", - "B": "ب", - "D": "د", - "E": "ع", - "G": "ق", - "H": "ه", - "J": "ح", - "K": "ك", - "L": "ل", - "N": "ن", - "R": "ر", - "S": "س", - "T": "ط", - "U": "و", - "V": "ى", - "X": "ص", - "Z": "م", - "0": "٠", - "1": "١", - "2": "٢", - "3": "٣", - "4": "٤", - "5": "٥", - "6": "٦", - "7": "٧", - "8": "٨", - "9": "٩", - } - - def license_plate_en(self) -> str: - """Generate a license plate in Latin/Western characters.""" - return self.bothify( - self.LICENSE_FORMAT_EN, - letters=self.PLATE_CHARS_EN, - ) - - def license_plate_ar(self) -> str: - """Generate a license plate in Arabic characters. - - This method first generates a license plate in Latin/Western characters - using |license_plate_en|, and the result is translated internally to - generate the Arabic counterpart which serves as this method's return - value. - """ - english_plate = self.license_plate_en() - return self._translate_license_plate(english_plate) - - def _translate_license_plate(self, license_plate: str) -> str: - nums = list(reversed(license_plate[0:4])) - chars = list(license_plate[5:8]) - - numerated = re.sub( - r"\#", - lambda x: self.PLATE_MAP[nums.pop()], - self.LICENSE_FORMAT_AR, - ) - ar_plate = re.sub( - r"\?", - lambda x: self.PLATE_MAP[chars.pop()], - numerated, - ) - - return ar_plate - - def license_plate(self, ar: bool = True) -> str: - return self.license_plate_ar() if ar else self.license_plate_en() diff --git a/venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__pycache__/__init__.cpython-311.pyc b/venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 45959dc..0000000 Binary files a/venv/lib/python3.11/site-packages/faker/providers/automotive/ar_SA/__pycache__/__init__.cpython-311.pyc and /dev/null differ -- cgit v1.2.3