arpakitlib 1.7.60__py3-none-any.whl → 1.7.61__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.
@@ -28,13 +28,13 @@ def setup_normal_logging(log_filepath: Optional[str] = None):
28
28
  if log_filepath:
29
29
  init_log_file(log_filepath=log_filepath)
30
30
 
31
- logger = logging.getLogger()
31
+ logger = logging.getLogger(__name__)
32
32
  logger.setLevel(logging.INFO)
33
33
 
34
34
  stream_handler = logging.StreamHandler()
35
35
  stream_handler.setLevel(logging.INFO)
36
36
  stream_formatter = logging.Formatter(
37
- "%(asctime)s | %(levelname)s | %(name)s - %(message)s",
37
+ "%(asctime)s | %(levelname)s | %(name)s | %(filename)s:%(lineno)d - %(message)s",
38
38
  datefmt="%d.%m.%Y %I:%M:%S%p"
39
39
  )
40
40
  stream_handler.setFormatter(stream_formatter)
@@ -87,6 +87,9 @@ class ScheduleUUSTAPIClient:
87
87
  proxy_url_=self.api_proxy_url,
88
88
  raise_for_status_=True
89
89
  )
90
+ json_data = await response.json()
91
+ if "error" in json_data.keys():
92
+ raise Exception(f"error in json_data, {json_data}")
90
93
  return response
91
94
 
92
95
  async def get_current_week(self) -> int:
@@ -176,20 +179,28 @@ class ScheduleUUSTAPIClient:
176
179
 
177
180
  async def check_conn(self):
178
181
  await self.get_current_week()
182
+ self._logger.info(f"connection is good")
179
183
 
180
184
  async def is_conn_good(self):
181
185
  try:
182
186
  await self.check_conn()
183
187
  except Exception as e:
184
- self._logger.error(e)
188
+ self._logger.error(f"connection is bad", exc_info=e)
185
189
  return False
186
190
  return True
187
191
 
188
192
  async def check_all(self):
189
- await self.get_groups()
190
- await self.get_teachers()
191
- await self.get_current_semester()
192
- await self.get_current_week()
193
+ groups = await self.get_groups()
194
+ self._logger.info(f"groups len: {len(groups)}")
195
+
196
+ teachers = await self.get_teachers()
197
+ self._logger.info(f"teachers len: {len(teachers)}")
198
+
199
+ current_semester = await self.get_current_semester()
200
+ self._logger.info(f"current_semester: {current_semester}")
201
+
202
+ current_week = await self.get_current_week()
203
+ self._logger.info(f"current_week: {current_week}")
193
204
 
194
205
 
195
206
  def __example():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.7.60
3
+ Version: 1.7.61
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -157,7 +157,7 @@ arpakitlib/ar_json_util.py,sha256=GwHDdrBWiJBHSc07Qe0aN1Gp_uM0pYpTwzU9JAgsKAo,97
157
157
  arpakitlib/ar_jwt_util.py,sha256=Rhm4ywoTAn6yOV8NLjDASfAtAtheROxxDP40G3XjnuQ,761
158
158
  arpakitlib/ar_list_of_dicts_to_xlsx.py,sha256=MyjEl4Jl4beLVZqLVQMMv0-XDtBD3Xh4Z_ZPDJeFu04,745
159
159
  arpakitlib/ar_list_util.py,sha256=2woOAHAU8oTIiVjZ8GLnx15odEaoQUq3Q0JPxlufFF0,457
160
- arpakitlib/ar_logging_util.py,sha256=Q9nI2au8a48wPQlueBUyAi3X4q-m59S2K9aNc1i21RA,2606
160
+ arpakitlib/ar_logging_util.py,sha256=_uuBLZg8S72Zf_hLnNtVC64X7KOSxxSDPhoXmV1Q-VI,2640
161
161
  arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
162
162
  arpakitlib/ar_need_type_util.py,sha256=xq5bbAXJG-93CRVZUcLW0ZdM22rj-ZUW17C5hX_5grg,1699
163
163
  arpakitlib/ar_openai_api_client_util.py,sha256=dHUbfg1sVVCjsNl_fra3iCMEz1bR-Hk9fE-DdYbu7Wc,1215
@@ -165,7 +165,7 @@ arpakitlib/ar_operation_execution_util.py,sha256=XMS5bLM-NubLv7HuTnt0Vi6YnE42pu3
165
165
  arpakitlib/ar_parse_command.py,sha256=-s61xcATIsfw1eV_iD3xi-grsitbGzSDoAFc5V0OFy4,3447
166
166
  arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
167
167
  arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
168
- arpakitlib/ar_schedule_uust_api_client_util.py,sha256=JD-hRUQSs-euK0zq9w_4QUfGO00yWM08gllWUVKTtHc,6109
168
+ arpakitlib/ar_schedule_uust_api_client_util.py,sha256=rAIxrAwURes5kuviFi2MA1VgOaWCZQtqmqsTf0QlAvY,6634
169
169
  arpakitlib/ar_settings_util.py,sha256=gnuC8rs7IkyXkRWurrV-K0jObDMMxeH_1NdfJLkekHA,1473
170
170
  arpakitlib/ar_sleep_util.py,sha256=OaLtRaJQWMkGjfj_mW1RB2P4RaSWsAIH8LUoXqsH0zM,1061
171
171
  arpakitlib/ar_sqlalchemy_model_util.py,sha256=TFGOAgpxcnBV_u7yZrLCkf1ldlB4Of8vIRsyk9kyP5c,4987
@@ -175,9 +175,9 @@ arpakitlib/ar_str_util.py,sha256=oCEtQ_TTn35OEz9jCNLjbhopq76JmaifD_iYR-nEJJ4,214
175
175
  arpakitlib/ar_type_util.py,sha256=e6Ch8I_B3FMJMj-fiZvTwtGde4hxSa48fGt5g8RlV6I,2301
176
176
  arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
177
177
  arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
178
- arpakitlib-1.7.60.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
179
- arpakitlib-1.7.60.dist-info/METADATA,sha256=i3KUi4t4rbu-G6m4pHJtxGu5MPdcRIpOwyh71pi3QM4,2824
180
- arpakitlib-1.7.60.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
181
- arpakitlib-1.7.60.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
182
- arpakitlib-1.7.60.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
183
- arpakitlib-1.7.60.dist-info/RECORD,,
178
+ arpakitlib-1.7.61.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
179
+ arpakitlib-1.7.61.dist-info/METADATA,sha256=PmjAnS0Lh5UszGti-k7161bCx8zhx9cUjffy5V7YK5g,2824
180
+ arpakitlib-1.7.61.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
181
+ arpakitlib-1.7.61.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
182
+ arpakitlib-1.7.61.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
183
+ arpakitlib-1.7.61.dist-info/RECORD,,