fnschool 20251101.82236.812__py3-none-any.whl → 20251102.81729.808__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 fnschool might be problematic. Click here for more details.

fnschoo1/__init__.py CHANGED
@@ -6,4 +6,4 @@ import random
6
6
  import sys
7
7
  from pathlib import Path
8
8
 
9
- __version__ = "20251101.82236.812"
9
+ __version__ = "20251102.81729.808"
@@ -170,11 +170,6 @@ LOGIN_URL = reverse_lazy("fnprofile:log_in")
170
170
 
171
171
  _settings_path = Path(__file__).parent / "_settings.py"
172
172
  if _settings_path.exists():
173
- print(
174
- ('Custom configuration "{_settings_path}" has been used.').format(
175
- _settings_path=_settings_path.as_posix()
176
- )
177
- )
178
- from ._settings import *
173
+ from fnschool._settings import *
179
174
 
180
175
  # The end.
fnschoo1/manage.py CHANGED
@@ -1,5 +1,5 @@
1
- #!/usr/bin/env python3
2
1
  """Django's command-line utility for administrative tasks."""
2
+
3
3
  import os
4
4
  import platform
5
5
  import random
@@ -22,6 +22,20 @@ elif system_name == "Windows":
22
22
  elif system_name == "Darwin":
23
23
  is_macos = True
24
24
 
25
+ sys_executable = sys.executable
26
+
27
+
28
+ def run_patches():
29
+ if "202511012053_copy_profiles_to_fnprofile" in sys.argv:
30
+ patche_path = (
31
+ FNSCHOOL_PATH
32
+ / "patches"
33
+ / "202511012053_copy_profiles_to_fnprofile.py"
34
+ )
35
+ patche_path = patche_path.as_posix()
36
+ os.system(f"{sys_executable} {patche_path} run")
37
+ sys.exit()
38
+
25
39
 
26
40
  def main():
27
41
  """Run administrative tasks."""
@@ -38,28 +52,18 @@ def main():
38
52
  os.chdir(FNSCHOOL_PATH)
39
53
  sys.argv[0] = "manage.py"
40
54
 
41
- if "202511012053_copy_profiles_to_fnprofile" in sys.argv:
42
- patche_path = (
43
- FNSCHOOL_PATH
44
- / "patches"
45
- / "202511012053_copy_profiles_to_fnprofile.py"
46
- )
47
- patche_path = patche_path.as_posix()
48
- os.system(f"python3 {patche_path} run")
49
- return
55
+ run_patches()
50
56
 
51
57
  if len(sys.argv) < 2:
52
58
  local_port = "8230"
53
59
  local_url = "http://127.0.0.1:" + local_port
54
60
  sys.argv.append("runserver")
55
61
  sys.argv.append(str(local_port))
56
- try:
57
- if is_windows:
58
- os.startfile(local_url)
59
- else:
60
- os.system("open " + local_url + "&")
61
- except Exception as e:
62
- print(e)
62
+
63
+ if is_windows:
64
+ os.startfile(local_url)
65
+ else:
66
+ os.system("open " + local_url + "&")
63
67
 
64
68
  execute_from_command_line(sys.argv)
65
69
 
@@ -8,11 +8,12 @@ file_path = Path(__file__)
8
8
  data_path = Path(file_path.with_suffix("").as_posix() + "_data")
9
9
  data_name = data_path.stem
10
10
 
11
+ patches_path = file_path.parent
12
+ fnscho1_path = patches_path.parent
13
+
11
14
  settings_temp_path = data_path / "settings.py"
12
15
  profiles_path = data_path / "profiles"
13
16
 
14
- patches_path = file_path.parent
15
- fnscho1_path = patches_path.parent
16
17
  src_path = fnscho1_path.parent
17
18
  db_path = fnscho1_path / "db.sqlite3"
18
19
 
@@ -26,26 +27,27 @@ cursor.execute(
26
27
  ("fnprofile_fnuser",),
27
28
  )
28
29
  fnprofile_fnuser_exists = cursor.fetchone() is not None
30
+ conn.close()
31
+
32
+ sys_executable = sys.executable
29
33
 
30
34
 
31
35
  def run():
32
36
  if fnprofile_fnuser_exists:
33
- print((f"Patch {0} had been applied successfully!").format(patch_name))
37
+ print(('Patch "{0}" had been applied successfully!').format(patch_name))
34
38
  return
35
39
 
36
40
  os.system(
37
- ("python manage.py migrate --settings {0}").format(settings_temp_name)
41
+ ("{0} manage.py migrate --settings {1}").format(
42
+ sys_executable, settings_temp_name
43
+ )
38
44
  )
39
45
  os.system(
40
- ("python manage.py makemigrations --settings {0}").format(
41
- settings_temp_name
46
+ ("{0} manage.py makemigrations --settings {1}").format(
47
+ sys_executable, settings_temp_name
42
48
  )
43
49
  )
44
- print((f"Patch {0} applied successfully!").format(patch_name))
45
-
46
-
47
- def rollback():
48
- print((f"Patch {0} rolled back!").format(patch_name))
50
+ print(('Patch "{0}" applied successfully!').format(patch_name))
49
51
 
50
52
 
51
53
  def main():
@@ -55,12 +57,14 @@ def main():
55
57
 
56
58
  func_name = sys.argv[1]
57
59
 
58
- function_dict = {"run": run, "rollback": rollback}
60
+ function_dict = {
61
+ "run": run,
62
+ }
59
63
 
60
64
  if func_name in function_dict:
61
65
  function_dict[func_name]()
62
66
  else:
63
- print(f"Error: Function '{func_name}' not found.")
67
+ print(f'Error: Function "{func_name}" not found.')
64
68
 
65
69
 
66
70
  if __name__ == "__main__":
@@ -1,3 +1,5 @@
1
+ import importlib
2
+
1
3
  from django.apps import AppConfig
2
4
 
3
5
 
@@ -6,5 +8,10 @@ class ProfilesConfig(AppConfig):
6
8
  # name = "profiles"
7
9
  name = "patches.202511012053_copy_profiles_to_fnprofile_data.profiles"
8
10
 
11
+ def ready(sef):
12
+ importlib.import_module(
13
+ "patches.202511012053_copy_profiles_to_fnprofile_data.profiles.signals"
14
+ )
15
+
9
16
 
10
17
  # The end.
@@ -18,7 +18,6 @@ from django.utils.translation import gettext_lazy as _
18
18
 
19
19
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
20
20
  BASE_DIR = Path(__file__).resolve().parent.parent.parent
21
- print(BASE_DIR)
22
21
 
23
22
  # Quick-start development settings - unsuitable for production
24
23
  # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
@@ -169,13 +168,4 @@ MEDIA_ROOT = os.path.join(BASE_DIR, "media")
169
168
 
170
169
  LOGIN_URL = reverse_lazy("fnprofile:log_in")
171
170
 
172
- _settings_path = Path(__file__).parent / "_settings.py"
173
- if _settings_path.exists():
174
- print(
175
- ('Custom configuration "{_settings_path}" has been used.').format(
176
- _settings_path=_settings_path.as_posix()
177
- )
178
- )
179
- from ._settings import *
180
-
181
171
  # The end.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fnschool
3
- Version: 20251101.82236.812
3
+ Version: 20251102.81729.808
4
4
  Summary: Just some school related scripts, without any ambition.
5
5
  Author-email: larryw3i <larryw3i@163.com>, Larry Wei <larryw3i@126.com>, Larry W3i <larryw3i@yeah.net>
6
6
  Maintainer-email: larryw3i <larryw3i@163.com>, Larry Wei <larryw3i@126.com>
@@ -1,5 +1,5 @@
1
- fnschoo1/__init__.py,sha256=QXiZ_JOJ0Aj0ambnFOhIZsMzXG3SfbguoKhBDn9GNx0,197
2
- fnschoo1/manage.py,sha256=0zVlx8Y8tfc0tLAz9oeWDXHG-L0sy5AkI3cX6wYBPcY,1853
1
+ fnschoo1/__init__.py,sha256=E5sdFPNpLrogwl5GSGVTJdXbcVUKf8-ciCgOZ-8Rlvw,197
2
+ fnschoo1/manage.py,sha256=ivqNFnJ7hNkZ1NteTLawH_1z303TXB1HWuNFfTS0cFs,1836
3
3
  fnschoo1/canteen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  fnschoo1/canteen/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
5
5
  fnschoo1/canteen/apps.py,sha256=zUjM0ZJwHW4i72vOm87QewRlvFQORQo5yb053u4YIGs,146
@@ -78,7 +78,7 @@ fnschoo1/fnprofile/templates/fnprofile/log_out.html,sha256=siA56sam_0XEanX40H7Oa
78
78
  fnschoo1/fnschool/__init__.py,sha256=TmHhzykpKNMoMf6eD-EKvbvmnlzs1XGHtvD55ae1sXs,287
79
79
  fnschoo1/fnschool/_settings.py,sha256=ajz1GSNU9xYVrFEDSz6Xwg7amWQ_yvW75tQa1ZvRIWc,3
80
80
  fnschoo1/fnschool/asgi.py,sha256=kzkqosS10uBlyBX53EXcsATcvEZmac6nsPzyOHCuucE,393
81
- fnschoo1/fnschool/settings.py,sha256=a9QnpTktXgoC70i6QvApSHEUxtYK--66xxLZEAj8-yc,4717
81
+ fnschoo1/fnschool/settings.py,sha256=T5K2HlFmTe2B7U6YoVpll7TZP8XBn2EWZ7Ct8SyHJgg,4570
82
82
  fnschoo1/fnschool/urls.py,sha256=lSFq0ZQSkaVWFCnsVDjZeebnIRkpBgKdjLa6hQAZzwE,1339
83
83
  fnschoo1/fnschool/views.py,sha256=yMtB28KadYBXHxl7rtDMX7LlAV94WMt_PqmPRWpy2S4,176
84
84
  fnschoo1/fnschool/wsgi.py,sha256=dQq4S0vZWCz8w5R9KooJeLYTVFXvEgJRYe7NFZwVxU8,393
@@ -86,13 +86,13 @@ fnschoo1/fnschool/templatetags/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCc
86
86
  fnschoo1/fnschool/templatetags/fnschool_tags.py,sha256=l5Zov4VlQKpz-69SFftP4kXyMymz-a0D5F_ss_eiFc4,568
87
87
  fnschoo1/locale/en/LC_MESSAGES/django.mo,sha256=M8AB6fmjwlEd761iFlasNWdiEYfE-2nIwBoioGtEVUo,404
88
88
  fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=CWhKOcM21iNxOHF8WgjAKPio1L5gVnNF4iOCmNPQZoI,23707
89
- fnschoo1/patches/202511012053_copy_profiles_to_fnprofile.py,sha256=2Vyg1brUu5XX4N9FZ89jyRoq3t6YCBfzBzZ4PeAeeG4,1632
89
+ fnschoo1/patches/202511012053_copy_profiles_to_fnprofile.py,sha256=4mCvJKeVbxHrYJFuB4axNSVmNXq5yAccPVXexLD8mgM,1646
90
90
  fnschoo1/patches/__init__.py,sha256=Zq9F_mCPtMKCrJ4r8hP3f7ZYULw6I1G8cKvEHLlxteA,61
91
91
  fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
92
- fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/settings.py,sha256=vCyfOPPUnYrYseULRB4fRUn-8NAFBmvglha483JqCDs,4798
92
+ fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/settings.py,sha256=4szjvFSigUCx1uIlGnLM0tfGx-y31C-4tMU19HloCJE,4513
93
93
  fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/profiles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
94
  fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/profiles/admin.py,sha256=93UCvdODI63KzCDfFFnKmfvCMGCp6FCG9WErE91i79Y,522
95
- fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/profiles/apps.py,sha256=SJERY1f2q1xZljZZrPw1boFc3Zbv_lsSWoWUKel4-04,238
95
+ fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/profiles/apps.py,sha256=PdZ7bYE0_V6mIyg86zrVAwFWbHBJ_mSZ7XaEAwk5dAI,404
96
96
  fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/profiles/forms.py,sha256=ilTUlBySQgszWpUA9ioFQUr09uXZIuKTde_e_K57Ll8,2063
97
97
  fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/profiles/models.py,sha256=kwAzYWcg-uQ-_BaBsra32Oh4z4JXe8au9ki7qTflOm0,1933
98
98
  fnschoo1/patches/202511012053_copy_profiles_to_fnprofile_data/profiles/signals.py,sha256=u5cv6xoZ7PUrKoD6ZOVWLLKg_93w_FCgWIiC4DxJADA,486
@@ -134,14 +134,14 @@ fnschoo1/templates/includes/_navigation.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
134
134
  fnschoo1/templates/includes/_paginator.html,sha256=Q-FRCODFNlETjn2yX18IfhctRWfqEgEnIc5LcdHzKSo,1262
135
135
  fnschoo1/templates/registration/logged_out.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
136
  fnschoo1/templates/registration/login.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
137
- fnschool-20251101.82236.812.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
138
- fnschool-20251101.82236.812.dist-info/METADATA,sha256=j8tl5FAu8EnKxaFptiQ2LzQBCvdcoqlCk_vOFsB9SZI,4752
139
- fnschool-20251101.82236.812.dist-info/SOURCES.txt.py,sha256=2LY2mshgNtxI3ICB-oBjyMYgJk2bQqeGFM5J5ay5TQs,4954
140
- fnschool-20251101.82236.812.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
141
- fnschool-20251101.82236.812.dist-info/dependency_links.txt.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
142
- fnschool-20251101.82236.812.dist-info/entry_points.txt,sha256=Ow5nChVFJY3O4TJAIE1ZydMev1MUtgRsT1b8eFP6728,54
143
- fnschool-20251101.82236.812.dist-info/entry_points.txt.py,sha256=7iOwIx_m9Y6xJt___BZHWJh27LV5hqWnUjmj77MoRys,47
144
- fnschool-20251101.82236.812.dist-info/requires.txt.py,sha256=PqRcHIQSMPUb271hacYrlSDHwB1WDZmlWUkh6RnBz_g,113
145
- fnschool-20251101.82236.812.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
146
- fnschool-20251101.82236.812.dist-info/top_level.txt.py,sha256=_7CbrSihm0dzBn_tTy2ass_Y2VlkVNT2eylE8mcfwHY,9
147
- fnschool-20251101.82236.812.dist-info/RECORD,,
137
+ fnschool-20251102.81729.808.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
138
+ fnschool-20251102.81729.808.dist-info/METADATA,sha256=km7UU6nzFIi56GkuAb7D9EpPmfKZQGZ428jnobDZuBE,4752
139
+ fnschool-20251102.81729.808.dist-info/SOURCES.txt.py,sha256=2LY2mshgNtxI3ICB-oBjyMYgJk2bQqeGFM5J5ay5TQs,4954
140
+ fnschool-20251102.81729.808.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
141
+ fnschool-20251102.81729.808.dist-info/dependency_links.txt.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
142
+ fnschool-20251102.81729.808.dist-info/entry_points.txt,sha256=Ow5nChVFJY3O4TJAIE1ZydMev1MUtgRsT1b8eFP6728,54
143
+ fnschool-20251102.81729.808.dist-info/entry_points.txt.py,sha256=7iOwIx_m9Y6xJt___BZHWJh27LV5hqWnUjmj77MoRys,47
144
+ fnschool-20251102.81729.808.dist-info/requires.txt.py,sha256=PqRcHIQSMPUb271hacYrlSDHwB1WDZmlWUkh6RnBz_g,113
145
+ fnschool-20251102.81729.808.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
146
+ fnschool-20251102.81729.808.dist-info/top_level.txt.py,sha256=_7CbrSihm0dzBn_tTy2ass_Y2VlkVNT2eylE8mcfwHY,9
147
+ fnschool-20251102.81729.808.dist-info/RECORD,,