rhul-attendance-bot 1.1.52__tar.gz → 1.1.56__tar.gz

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.
Files changed (23) hide show
  1. {rhul_attendance_bot-1.1.52/rhul_attendance_bot.egg-info → rhul_attendance_bot-1.1.56}/PKG-INFO +6 -1
  2. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/README.md +5 -0
  3. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/README_CN.md +5 -0
  4. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/RHUL_attendance_bot.py +15 -3
  5. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/pyproject.toml +1 -1
  6. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56/rhul_attendance_bot.egg-info}/PKG-INFO +6 -1
  7. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/LICENSE +0 -0
  8. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/MANIFEST.in +0 -0
  9. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/app_paths.py +0 -0
  10. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/assets/discord_bot_screenshot.png +0 -0
  11. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/assets/ui_screenshot.png +0 -0
  12. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/auto_login.py +0 -0
  13. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/discord_broadcast.py +0 -0
  14. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/display_manager.py +0 -0
  15. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/fetch_ics.py +0 -0
  16. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/local_2fa.py +0 -0
  17. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/rhul_attendance_bot.egg-info/SOURCES.txt +0 -0
  18. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/rhul_attendance_bot.egg-info/dependency_links.txt +0 -0
  19. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/rhul_attendance_bot.egg-info/entry_points.txt +0 -0
  20. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/rhul_attendance_bot.egg-info/requires.txt +0 -0
  21. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/rhul_attendance_bot.egg-info/top_level.txt +0 -0
  22. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/setup.cfg +0 -0
  23. {rhul_attendance_bot-1.1.52 → rhul_attendance_bot-1.1.56}/update.py +0 -0
@@ -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.56
4
4
  Summary: RHUL attendance automation bot
5
5
  Author: PandaQuQ
6
6
  License:
@@ -220,6 +220,11 @@ To configure the script, modify the relevant parameters inside the code or creat
220
220
 
221
221
  If an update is detected, the script will prompt you to update. You can choose to update by typing `y` or skip it by typing `n`.
222
222
 
223
+ ## Auto-Tag via GitHub Actions
224
+
225
+ If you prefer not to use local git hooks, this repo includes a GitHub Action that auto-creates a new patch tag on each push to `main`, then creates a GitHub Release and uploads the package to PyPI.
226
+ See workflow: [.github/workflows/auto-release.yml](.github/workflows/auto-release.yml)
227
+
223
228
  ## Troubleshooting
224
229
 
225
230
  1. **Chrome WebDriver Issues**: Make sure that the correct version of the ChromeDriver is being used. The script uses `webdriver-manager` to automatically manage ChromeDriver versions.
@@ -175,6 +175,11 @@ To configure the script, modify the relevant parameters inside the code or creat
175
175
 
176
176
  If an update is detected, the script will prompt you to update. You can choose to update by typing `y` or skip it by typing `n`.
177
177
 
178
+ ## Auto-Tag via GitHub Actions
179
+
180
+ If you prefer not to use local git hooks, this repo includes a GitHub Action that auto-creates a new patch tag on each push to `main`, then creates a GitHub Release and uploads the package to PyPI.
181
+ See workflow: [.github/workflows/auto-release.yml](.github/workflows/auto-release.yml)
182
+
178
183
  ## Troubleshooting
179
184
 
180
185
  1. **Chrome WebDriver Issues**: Make sure that the correct version of the ChromeDriver is being used. The script uses `webdriver-manager` to automatically manage ChromeDriver versions.
@@ -175,6 +175,11 @@ Profile 数据存放在 `~/.rhul_attendance_bot/profiles/<profile_name>` 下,
175
175
 
176
176
  如果检测到更新,脚本会提示您是否更新。可以输入 `y` 更新,也可以输入 `n` 跳过更新。
177
177
 
178
+ ## GitHub Actions 自动打 tag
179
+
180
+ 如果不想使用本地 git hooks,可以使用 GitHub Actions 在每次 push 到 `main` 时自动生成 patch 新 tag,并自动创建 GitHub Release 和上传 PyPI。
181
+ 工作流文件: [.github/workflows/auto-release.yml](.github/workflows/auto-release.yml)
182
+
178
183
  ## 常见问题
179
184
 
180
185
  1. **Chrome WebDriver 问题**:确保使用的是正确版本的 ChromeDriver。脚本使用 `webdriver-manager` 自动管理 ChromeDriver 版本。
@@ -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:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rhul-attendance-bot"
7
- version = "1.1.52"
7
+ version = "1.1.56"
8
8
  description = "RHUL attendance automation bot"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -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.56
4
4
  Summary: RHUL attendance automation bot
5
5
  Author: PandaQuQ
6
6
  License:
@@ -220,6 +220,11 @@ To configure the script, modify the relevant parameters inside the code or creat
220
220
 
221
221
  If an update is detected, the script will prompt you to update. You can choose to update by typing `y` or skip it by typing `n`.
222
222
 
223
+ ## Auto-Tag via GitHub Actions
224
+
225
+ If you prefer not to use local git hooks, this repo includes a GitHub Action that auto-creates a new patch tag on each push to `main`, then creates a GitHub Release and uploads the package to PyPI.
226
+ See workflow: [.github/workflows/auto-release.yml](.github/workflows/auto-release.yml)
227
+
223
228
  ## Troubleshooting
224
229
 
225
230
  1. **Chrome WebDriver Issues**: Make sure that the correct version of the ChromeDriver is being used. The script uses `webdriver-manager` to automatically manage ChromeDriver versions.