cdx-manager 0.9.10 → 0.9.12

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.
@@ -24,7 +24,7 @@ def _restrict_dir_permissions(path):
24
24
 
25
25
  def _read_json(file_path, fallback):
26
26
  try:
27
- with open(file_path, "r", encoding="utf-8") as f:
27
+ with open(file_path, encoding="utf-8") as f:
28
28
  return json.load(f)
29
29
  except FileNotFoundError:
30
30
  return fallback
@@ -273,7 +273,7 @@ def create_session_store(base_dir):
273
273
  def list_launch_history(session_name=None, limit=20):
274
274
  with _file_lock(lock_file):
275
275
  try:
276
- with open(launch_history_file, "r", encoding="utf-8") as handle:
276
+ with open(launch_history_file, encoding="utf-8") as handle:
277
277
  lines = handle.readlines()
278
278
  except FileNotFoundError:
279
279
  return []
@@ -307,22 +307,6 @@ def _parse_month_index(name):
307
307
  return -1
308
308
 
309
309
 
310
- def _infer_reset_year(month, day):
311
- now = datetime.now().astimezone()
312
- year = now.year
313
- try:
314
- candidate = datetime(
315
- year,
316
- month + 1,
317
- day,
318
- tzinfo=now.tzinfo,
319
- )
320
- except ValueError:
321
- return year
322
- two_days_ago = datetime.fromtimestamp(now.timestamp() - 2 * 24 * 3600, tz=now.tzinfo)
323
- return year + 1 if candidate < two_days_ago else year
324
-
325
-
326
310
  def _normalize_reset_date(raw):
327
311
  if not raw:
328
312
  return None
@@ -349,7 +333,6 @@ def _normalize_reset_date(raw):
349
333
  hours, minutes, day, month_str = int(m[1]), int(m[2]), int(m[3]), m[4]
350
334
  month = _parse_month_index(month_str)
351
335
  if month != -1:
352
- year = _infer_reset_year(month, day)
353
336
  return f"{MONTH_ABBR[month]} {day} {pad(hours)}:{pad(minutes)}"
354
337
 
355
338
  # Claude: "Thursday, April 17 at 5:00 AM" or "April 17, 2026, 5 PM"
@@ -363,7 +346,6 @@ def _normalize_reset_date(raw):
363
346
  month = _parse_month_index(m[1])
364
347
  if month != -1:
365
348
  day = int(m[2])
366
- year = int(m[3]) if m[3] else _infer_reset_year(month, day)
367
349
  if m[4]:
368
350
  hours, minutes = parse_ampm(int(m[4]), int(m[5] or 0), m[6])
369
351
  return f"{MONTH_ABBR[month]} {day} {format_time(hours, minutes)}"
@@ -397,7 +379,6 @@ def _normalize_reset_date(raw):
397
379
  month = _parse_month_index(m[1])
398
380
  if month != -1:
399
381
  day = int(m[2])
400
- year = int(m[3]) if m[3] else _infer_reset_year(month, day)
401
382
  return f"{MONTH_ABBR[month]} {day}"
402
383
 
403
384
  return None
@@ -1,5 +1,5 @@
1
1
  from datetime import datetime
2
- from decimal import Decimal, InvalidOperation, ROUND_HALF_UP
2
+ from decimal import ROUND_HALF_UP, Decimal, InvalidOperation
3
3
 
4
4
  from .cli_render import (
5
5
  _dim,
@@ -6,7 +6,6 @@ import urllib.error
6
6
  import urllib.request
7
7
  from datetime import datetime, timezone
8
8
 
9
-
10
9
  UPDATE_CHECK_TTL_SECONDS = 60 * 60
11
10
  LATEST_RELEASE_URL = "https://api.github.com/repos/AlexAgo83/cdx-manager/releases/latest"
12
11
  LOGICS_MANAGER_LATEST_URL = "https://registry.npmjs.org/@grifhinz%2Flogics-manager/latest"
@@ -49,7 +48,7 @@ def _tool_cache_path(base_dir, tool):
49
48
 
50
49
  def _read_cache(path):
51
50
  try:
52
- with open(path, "r", encoding="utf-8") as handle:
51
+ with open(path, encoding="utf-8") as handle:
53
52
  return json.load(handle)
54
53
  except (FileNotFoundError, OSError, json.JSONDecodeError):
55
54
  return None