rhul-attendance-bot 1.1.52__py3-none-any.whl → 1.1.56__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 +15 -3
- {rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/METADATA +6 -1
- {rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/RECORD +7 -7
- {rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/WHEEL +0 -0
- {rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/entry_points.txt +0 -0
- {rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/licenses/LICENSE +0 -0
- {rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/top_level.txt +0 -0
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
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
RHUL_attendance_bot.py,sha256=
|
|
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.
|
|
10
|
-
rhul_attendance_bot-1.1.
|
|
11
|
-
rhul_attendance_bot-1.1.
|
|
12
|
-
rhul_attendance_bot-1.1.
|
|
13
|
-
rhul_attendance_bot-1.1.
|
|
14
|
-
rhul_attendance_bot-1.1.
|
|
9
|
+
rhul_attendance_bot-1.1.56.dist-info/licenses/LICENSE,sha256=iBk7hceb7NgwcLnsFlT_v2SE2-m9i8CzsjlvBw8xmPg,1075
|
|
10
|
+
rhul_attendance_bot-1.1.56.dist-info/METADATA,sha256=8L04H8WIZCvSUzPDoANk0q5lqKp2ccb5ntbnVUdMHvI,10568
|
|
11
|
+
rhul_attendance_bot-1.1.56.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
rhul_attendance_bot-1.1.56.dist-info/entry_points.txt,sha256=TH2lA3ukDDxlnFr2CIy0xd1ZbsaO6FMjuUTDUIbkShs,65
|
|
13
|
+
rhul_attendance_bot-1.1.56.dist-info/top_level.txt,sha256=TABKd3ZTI6hvA899O5XSRt0lk58h9dxrv6QHChtJqmU,102
|
|
14
|
+
rhul_attendance_bot-1.1.56.dist-info/RECORD,,
|
|
File without changes
|
{rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{rhul_attendance_bot-1.1.52.dist-info → rhul_attendance_bot-1.1.56.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|