koleo-cli 0.2.137.15__py3-none-any.whl → 0.2.137.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of koleo-cli might be problematic. Click here for more details.
- koleo/cli.py +13 -13
- koleo/utils.py +1 -1
- {koleo_cli-0.2.137.15.dist-info → koleo_cli-0.2.137.16.dist-info}/METADATA +3 -3
- koleo_cli-0.2.137.16.dist-info/RECORD +13 -0
- {koleo_cli-0.2.137.15.dist-info → koleo_cli-0.2.137.16.dist-info}/WHEEL +1 -1
- koleo_cli-0.2.137.15.dist-info/RECORD +0 -13
- {koleo_cli-0.2.137.15.dist-info → koleo_cli-0.2.137.16.dist-info}/LICENSE +0 -0
- {koleo_cli-0.2.137.15.dist-info → koleo_cli-0.2.137.16.dist-info}/entry_points.txt +0 -0
- {koleo_cli-0.2.137.15.dist-info → koleo_cli-0.2.137.16.dist-info}/top_level.txt +0 -0
koleo/cli.py
CHANGED
|
@@ -224,14 +224,7 @@ class CLI:
|
|
|
224
224
|
self.print(self.train_route_table(train_details))
|
|
225
225
|
|
|
226
226
|
def connections(
|
|
227
|
-
self,
|
|
228
|
-
start: str,
|
|
229
|
-
end: str,
|
|
230
|
-
date: datetime,
|
|
231
|
-
brands: list[str],
|
|
232
|
-
direct: bool,
|
|
233
|
-
purchasable: bool,
|
|
234
|
-
length: int = 1
|
|
227
|
+
self, start: str, end: str, date: datetime, brands: list[str], direct: bool, purchasable: bool, length: int = 1
|
|
235
228
|
):
|
|
236
229
|
start_station = self.get_station(start)
|
|
237
230
|
end_station = self.get_station(end)
|
|
@@ -241,7 +234,7 @@ class CLI:
|
|
|
241
234
|
connection_brands = {i["name"]: i["id"] for i in api_brands}
|
|
242
235
|
else:
|
|
243
236
|
connection_brands = {
|
|
244
|
-
i["name"]:i["id"]
|
|
237
|
+
i["name"]: i["id"]
|
|
245
238
|
for i in api_brands
|
|
246
239
|
if i["name"].lower().strip() in brands or i["logo_text"].lower().strip() in brands
|
|
247
240
|
}
|
|
@@ -252,17 +245,22 @@ class CLI:
|
|
|
252
245
|
fetch_date = date
|
|
253
246
|
while len(results) < length:
|
|
254
247
|
connections = self.client.get_connections(
|
|
255
|
-
start_station["name_slug"],
|
|
248
|
+
start_station["name_slug"],
|
|
249
|
+
end_station["name_slug"],
|
|
250
|
+
list(connection_brands.values()),
|
|
251
|
+
fetch_date,
|
|
252
|
+
direct,
|
|
253
|
+
purchasable,
|
|
256
254
|
)
|
|
257
255
|
if connections:
|
|
258
|
-
fetch_date = arr_dep_to_dt(connections[-1]["departure"]) + timedelta(seconds=(30*60)+1)
|
|
256
|
+
fetch_date = arr_dep_to_dt(connections[-1]["departure"]) + timedelta(seconds=(30 * 60) + 1) # wtf
|
|
259
257
|
results.extend(connections)
|
|
260
258
|
else:
|
|
261
259
|
break
|
|
262
260
|
link = (
|
|
263
261
|
f"https://koleo.pl/rozklad-pkp/{start_station["name_slug"]}/{end_station["name_slug"]}"
|
|
264
262
|
+ f"/{date.strftime("%d-%m-%Y_%H:%M")}"
|
|
265
|
-
+f"{"all" if not direct else "direct"}/{"-".join(connection_brands.keys()) if brands else "all"}"
|
|
263
|
+
+ f"{"all" if not direct else "direct"}/{"-".join(connection_brands.keys()) if brands else "all"}"
|
|
266
264
|
)
|
|
267
265
|
parts = [
|
|
268
266
|
f"[bold blue][link={link}]{start_station["name"]} → {end_station["name"]} at {date.strftime("%H:%M %d-%m")}[/link][/bold blue]"
|
|
@@ -524,7 +522,9 @@ def main():
|
|
|
524
522
|
type=int,
|
|
525
523
|
default=1,
|
|
526
524
|
)
|
|
527
|
-
connections.set_defaults(
|
|
525
|
+
connections.set_defaults(
|
|
526
|
+
func=cli.connections, pass_=["start", "end", "brands", "date", "direct", "purchasable", "length"]
|
|
527
|
+
)
|
|
528
528
|
|
|
529
529
|
args = parser.parse_args()
|
|
530
530
|
|
koleo/utils.py
CHANGED
|
@@ -70,7 +70,7 @@ NUMERAL_TO_ARABIC = {
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
def convert_platform_number(number: str | None) -> int | None | str:
|
|
73
|
-
if number and number[-1] in "abcdefghi":
|
|
73
|
+
if number and number[-1] in "abcdefghi": # just to be safe...
|
|
74
74
|
arabic = NUMERAL_TO_ARABIC.get(number[:-1])
|
|
75
75
|
return f"{arabic}{number[-1]}" if arabic else None
|
|
76
76
|
return NUMERAL_TO_ARABIC.get(number)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: koleo-cli
|
|
3
|
-
Version: 0.2.137.
|
|
3
|
+
Version: 0.2.137.16
|
|
4
4
|
Summary: Koleo CLI
|
|
5
5
|
Home-page: https://github.com/lzgirlcat/koleo-cli
|
|
6
6
|
Author: Zoey !
|
|
@@ -14,8 +14,8 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Requires-Python: >=3.12
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: rich
|
|
18
|
-
Requires-Dist: requests
|
|
17
|
+
Requires-Dist: rich~=13.7
|
|
18
|
+
Requires-Dist: requests~=2.32
|
|
19
19
|
|
|
20
20
|
# Koleo CLI
|
|
21
21
|
[](https://pypi.org/project/koleo-cli)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
koleo/__init__.py,sha256=N_IkOBZCSPCCw31Hu72CFys707PziGFmXpNVl0CXAz8,47
|
|
2
|
+
koleo/__main__.py,sha256=wu5N2wk8mvBgyvr2ghmQf4prezAe0_i-p123VVreyYc,62
|
|
3
|
+
koleo/api.py,sha256=J05sdOg0S0VgcJNcmmoE8fYMKVVmtqkw5Sy88e-C91k,5713
|
|
4
|
+
koleo/cli.py,sha256=7cRfzAGdbkONXb5uk43lt6HH92TR4ruNyNtGa3N9hCw,24738
|
|
5
|
+
koleo/storage.py,sha256=L31IrXxdWiGGOraVBdFeHc1Z-a2fNvyRn-uC7gJWe9E,2305
|
|
6
|
+
koleo/types.py,sha256=pjVCIH39rUNeipazeRKOuTRCWoslLdbGivKiQmfd5Pw,5226
|
|
7
|
+
koleo/utils.py,sha256=AWRmyO2y0ol2t2EjznamZTlxcIxBaTTkxl9Ha0XBv4s,2007
|
|
8
|
+
koleo_cli-0.2.137.16.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
9
|
+
koleo_cli-0.2.137.16.dist-info/METADATA,sha256=y1DauN9svwBMG3cPnaexjps4n1gatNd6RLJDYA1jozM,3092
|
|
10
|
+
koleo_cli-0.2.137.16.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
|
11
|
+
koleo_cli-0.2.137.16.dist-info/entry_points.txt,sha256=LtCidkVDq8Zd7-fxpRbys1Xa9LTHMZwXVbdcQEscdes,41
|
|
12
|
+
koleo_cli-0.2.137.16.dist-info/top_level.txt,sha256=AlWdXotkRYzHpFfOBYi6xOXl1H0zq4-tqtZ2XivoWB4,6
|
|
13
|
+
koleo_cli-0.2.137.16.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
koleo/__init__.py,sha256=N_IkOBZCSPCCw31Hu72CFys707PziGFmXpNVl0CXAz8,47
|
|
2
|
-
koleo/__main__.py,sha256=wu5N2wk8mvBgyvr2ghmQf4prezAe0_i-p123VVreyYc,62
|
|
3
|
-
koleo/api.py,sha256=J05sdOg0S0VgcJNcmmoE8fYMKVVmtqkw5Sy88e-C91k,5713
|
|
4
|
-
koleo/cli.py,sha256=o2Ixo9uegZ7VHL98SoV49Vn2U1VyBp2sqFFZGsbvBb0,24692
|
|
5
|
-
koleo/storage.py,sha256=L31IrXxdWiGGOraVBdFeHc1Z-a2fNvyRn-uC7gJWe9E,2305
|
|
6
|
-
koleo/types.py,sha256=pjVCIH39rUNeipazeRKOuTRCWoslLdbGivKiQmfd5Pw,5226
|
|
7
|
-
koleo/utils.py,sha256=cpcFcEbgDOzPJ_gFr-JRKlKE61KnWZEgLX4p9rtfqNA,2006
|
|
8
|
-
koleo_cli-0.2.137.15.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
9
|
-
koleo_cli-0.2.137.15.dist-info/METADATA,sha256=IRMKtd_o63cwl4zQtmyyAGCz8EW9W9j_FfoYKdoFFk4,3096
|
|
10
|
-
koleo_cli-0.2.137.15.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
11
|
-
koleo_cli-0.2.137.15.dist-info/entry_points.txt,sha256=LtCidkVDq8Zd7-fxpRbys1Xa9LTHMZwXVbdcQEscdes,41
|
|
12
|
-
koleo_cli-0.2.137.15.dist-info/top_level.txt,sha256=AlWdXotkRYzHpFfOBYi6xOXl1H0zq4-tqtZ2XivoWB4,6
|
|
13
|
-
koleo_cli-0.2.137.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|