rhul-attendance-bot 1.1.52__py3-none-any.whl → 1.1.53__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.
RHUL_attendance_bot.py CHANGED
@@ -144,6 +144,12 @@ def main():
144
144
  # Run auto_login.py for first-time login
145
145
  if profiles_before:
146
146
  subprocess.run([sys.executable, os.path.join(script_dir, 'auto_login.py'), '--user', profile_name])
147
+ profiles_after = list_profiles()
148
+ if not profile_exists(profile_name):
149
+ if len(profiles_after) == 1:
150
+ profile_name = profiles_after[0]
151
+ else:
152
+ profile_name = prompt_select_profile()
147
153
  else:
148
154
  subprocess.run([sys.executable, os.path.join(script_dir, 'auto_login.py')])
149
155
  profiles_after = list_profiles()
@@ -483,11 +489,12 @@ def main():
483
489
  return str(delta).split('.')[0]
484
490
 
485
491
  def ensure_profile_nickname():
492
+ data = {}
486
493
  try:
487
494
  with open(credentials_path, 'r') as f:
488
495
  data = json.load(f)
489
496
  except Exception:
490
- return None
497
+ data = {}
491
498
  if data.get('profile_nickname'):
492
499
  return data.get('profile_nickname')
493
500
  while True:
@@ -522,14 +529,19 @@ def main():
522
529
  broadcaster = DiscordBroadcaster(credentials_path=credentials_path, logger=logger, profile_name=profile_nickname)
523
530
 
524
531
  def get_git_info():
525
- """Return (hash, date, count) for current HEAD; fallback to unknown."""
532
+ """Return (hash, date, count) for current HEAD; fallback to package version."""
526
533
  try:
527
534
  commit = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=script_dir).decode().strip()
528
535
  commit_date = subprocess.check_output(['git', 'show', '-s', '--format=%cd', '--date=iso-strict', 'HEAD'], cwd=script_dir).decode().strip()
529
536
  commit_count = subprocess.check_output(['git', 'rev-list', '--count', 'HEAD'], cwd=script_dir).decode().strip()
530
537
  return commit, commit_date, commit_count
531
538
  except Exception:
532
- return "unknown", "unknown", "unknown"
539
+ try:
540
+ from importlib import metadata
541
+ pkg_version = metadata.version("rhul-attendance-bot")
542
+ return f"v{pkg_version}", "release", pkg_version
543
+ except Exception:
544
+ return "unknown", "unknown", "unknown"
533
545
 
534
546
  def get_attendance_count():
535
547
  with counter_lock:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rhul-attendance-bot
3
- Version: 1.1.52
3
+ Version: 1.1.53
4
4
  Summary: RHUL attendance automation bot
5
5
  Author: PandaQuQ
6
6
  License:
@@ -1,4 +1,4 @@
1
- RHUL_attendance_bot.py,sha256=j6zr2yQHvzSmzO-7b66WVhEA-vL9RTVsDi7YooEEkfI,26103
1
+ RHUL_attendance_bot.py,sha256=qzGYMV3T7b-7r-pI6uHbgHx6GvomSjSsnl-KJxhLmYY,26633
2
2
  app_paths.py,sha256=xMpjXSCiMkLIvpsCfoRj61rHMLnWnkGzFOQ4JV8_J5A,3482
3
3
  auto_login.py,sha256=IfNu7WA-i75oLbJ5dQSWCZUAyloS86cKwhHue5wpoao,35234
4
4
  discord_broadcast.py,sha256=0hRJ_vronQK_TvRgC06NNWxaj8892h-Q7Hzmrp3-lB4,2615
@@ -6,9 +6,9 @@ display_manager.py,sha256=-hW4YocMrdhj_6AcGD-XU9WDIy9BFIym5mRqVH--iLc,11180
6
6
  fetch_ics.py,sha256=DkfH-XfdTeD-b9ZQvuLmfRE4R_wPwL0VjJaQwSP7LBM,7277
7
7
  local_2fa.py,sha256=2PY6XtczgIxjKqWls9DeN27MWLIiNKbQdk9E3GZVJxU,729
8
8
  update.py,sha256=kw_KWBJLu20JpMMmJQAAxu2ZZIlcUeRxppaVGr3S1r8,2354
9
- rhul_attendance_bot-1.1.52.dist-info/licenses/LICENSE,sha256=iBk7hceb7NgwcLnsFlT_v2SE2-m9i8CzsjlvBw8xmPg,1075
10
- rhul_attendance_bot-1.1.52.dist-info/METADATA,sha256=RwZEhf78qktVilgKDl4g3mpaGhRj5L4UHfqZXjdR0RI,10250
11
- rhul_attendance_bot-1.1.52.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
12
- rhul_attendance_bot-1.1.52.dist-info/entry_points.txt,sha256=TH2lA3ukDDxlnFr2CIy0xd1ZbsaO6FMjuUTDUIbkShs,65
13
- rhul_attendance_bot-1.1.52.dist-info/top_level.txt,sha256=TABKd3ZTI6hvA899O5XSRt0lk58h9dxrv6QHChtJqmU,102
14
- rhul_attendance_bot-1.1.52.dist-info/RECORD,,
9
+ rhul_attendance_bot-1.1.53.dist-info/licenses/LICENSE,sha256=iBk7hceb7NgwcLnsFlT_v2SE2-m9i8CzsjlvBw8xmPg,1075
10
+ rhul_attendance_bot-1.1.53.dist-info/METADATA,sha256=UrtIl6gd9I1iPpRyHk586ZDcyFmVq7WHiyD0zXSYvfI,10250
11
+ rhul_attendance_bot-1.1.53.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
12
+ rhul_attendance_bot-1.1.53.dist-info/entry_points.txt,sha256=TH2lA3ukDDxlnFr2CIy0xd1ZbsaO6FMjuUTDUIbkShs,65
13
+ rhul_attendance_bot-1.1.53.dist-info/top_level.txt,sha256=TABKd3ZTI6hvA899O5XSRt0lk58h9dxrv6QHChtJqmU,102
14
+ rhul_attendance_bot-1.1.53.dist-info/RECORD,,