From 37727e38bfcb35e7a65ca7effe160ea364358954 Mon Sep 17 00:00:00 2001 From: profitroll Date: Wed, 28 Sep 2022 15:12:41 +0200 Subject: [PATCH] More enums added --- pyrmv/enums/__init__.py | 6 ++++- pyrmv/enums/filter_mode.py | 14 ++++++++++++ pyrmv/enums/lang.py | 41 +++++++++++++++++++++++++++++++++++ pyrmv/enums/location_type.py | 32 +++++++++++++++++++++++++++ pyrmv/enums/product.py | 9 ++++---- pyrmv/enums/selection_mode.py | 11 ++++++++++ 6 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 pyrmv/enums/filter_mode.py create mode 100644 pyrmv/enums/lang.py create mode 100644 pyrmv/enums/location_type.py create mode 100644 pyrmv/enums/selection_mode.py diff --git a/pyrmv/enums/__init__.py b/pyrmv/enums/__init__.py index 986de86..efb8cd1 100644 --- a/pyrmv/enums/__init__.py +++ b/pyrmv/enums/__init__.py @@ -1,2 +1,6 @@ from .product import Product -from .rt_mode import RealTimeMode \ No newline at end of file +from .rt_mode import RealTimeMode +from .lang import Language +from .location_type import LocationType +from .selection_mode import SelectionMode +from .filter_mode import FilterMode \ No newline at end of file diff --git a/pyrmv/enums/filter_mode.py b/pyrmv/enums/filter_mode.py new file mode 100644 index 0000000..69414fc --- /dev/null +++ b/pyrmv/enums/filter_mode.py @@ -0,0 +1,14 @@ +from enum import auto +from .auto_name import AutoName + +class FilterMode(AutoName): + """Enumeration used to declare filters for nearby searches.""" + + DIST_PERI = auto() + "Accentuate matches. Matches in the radius are first." + + EXCL_PERI = auto() + "Returns matches inside the radius only." + + SLCT_PERI = auto() + "Matches in the radius are excluded. Returns matches outside the radius only." \ No newline at end of file diff --git a/pyrmv/enums/lang.py b/pyrmv/enums/lang.py new file mode 100644 index 0000000..f87c13f --- /dev/null +++ b/pyrmv/enums/lang.py @@ -0,0 +1,41 @@ +from enum import auto +from .auto_name import AutoName + +class Language(AutoName): + """Enumeration used to declare locales as ISO-3166 codes (but only available in HAFAS ones).""" + + DE = auto() + "German" + + DA = auto() + "Danish" + + EN = auto() + "English" + + ES = auto() + "Spanish" + + FR = auto() + "French" + + HU = auto() + "Hungarian" + + IT = auto() + "Italian" + + NL = auto() + "Dutch" + + NO = auto() + "Norwegian" + + PL = auto() + "Polish" + + SV = auto() + "Swedish" + + TR = auto() + "Turkish" \ No newline at end of file diff --git a/pyrmv/enums/location_type.py b/pyrmv/enums/location_type.py new file mode 100644 index 0000000..4208b4b --- /dev/null +++ b/pyrmv/enums/location_type.py @@ -0,0 +1,32 @@ +from enum import auto +from .auto_name import AutoName + +class LocationType(AutoName): + """Enumeration used to declare types of location filter.""" + + S = auto() + "Search for station/stops only" + + A = auto() + "Search for addresses only" + + P = auto() + "Search for POIs only" + + AP = auto() + "Search for addresses and POIs" + + SA = auto() + "Search for station/stops and addresses" + + SE = auto() + "Search for stations/stops and entrypoints" + + SP = auto() + "Search for stations/stops and POIs" + + ALL = auto() + "Search in all existing location pools" + + SPE = auto() + "Search for stations/stops, POIs and entrypoints" \ No newline at end of file diff --git a/pyrmv/enums/product.py b/pyrmv/enums/product.py index 2beb60c..45bf631 100644 --- a/pyrmv/enums/product.py +++ b/pyrmv/enums/product.py @@ -35,14 +35,13 @@ class Product(AutoNameProduct): "A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a road vehicle that carries significantly more passengers than an average car or van." BUS2 = auto() - "" + "Also a bus, but now idea why it exists anyway." FERRY = auto() - + "A ferry is a ship used to carry passengers, and sometimes vehicles and cargo, across a body of water." TAXI = auto() - + "A taxi, also known as a taxicab or simply a cab, is a type of vehicle for hire with a driver, used by a single passenger or small group of passengers, often for a non-shared ride." BAHN = auto() - - \ No newline at end of file + "Rail transport (also known as train transport) is a means of transport that transfers passengers and goods on wheeled vehicles running on rails, which are located on tracks. In contrast to road transport, where the vehicles run on a prepared flat surface, rail vehicles (rolling stock) are directionally guided by the tracks on which they run." \ No newline at end of file diff --git a/pyrmv/enums/selection_mode.py b/pyrmv/enums/selection_mode.py new file mode 100644 index 0000000..0bb5f61 --- /dev/null +++ b/pyrmv/enums/selection_mode.py @@ -0,0 +1,11 @@ +from enum import auto +from .auto_name import AutoName + +class SelectionMode(AutoName): + """Enumeration used to declare location selection modes.""" + + SLCT_A = auto() + "Selectable" + + SLCT_N = auto() + "Not selectable" \ No newline at end of file