hh-applicant-tool 0.3.3__py3-none-any.whl → 0.3.4__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 hh-applicant-tool might be problematic. Click here for more details.

@@ -134,7 +134,7 @@ class Operation(BaseOperation):
134
134
  if getenv("TEST_TELEMETRY"):
135
135
  break
136
136
 
137
- if vacancy["has_test"]:
137
+ if vacancy.get("has_test"):
138
138
  print("🚫 Пропускаем тест", vacancy["alternate_url"])
139
139
  continue
140
140
 
@@ -147,16 +147,23 @@ class Operation(BaseOperation):
147
147
  )
148
148
  continue
149
149
 
150
- employer_id = vacancy["employer"]["id"]
151
- employer = api.get(f"/employers/{employer_id}")
150
+ try:
151
+ employer_id = vacancy["employer"]["id"]
152
+ except IndexError:
153
+ logger.warning(
154
+ f"Вакансия без работодателя: {vacancy['alternate_url']}"
155
+ )
156
+ else:
157
+ employer = api.get(f"/employers/{employer_id}")
158
+
159
+ telemetry_data["employers"][employer_id] = {
160
+ "name": employer.get("name"),
161
+ "type": employer.get("type"),
162
+ "description": employer.get("description"),
163
+ "site_url": employer.get("site_url"),
164
+ "area": employer.get("area", {}).get("name"), # город
165
+ }
152
166
 
153
- telemetry_data["employers"][employer_id] = {
154
- "name": employer.get("name"),
155
- "type": employer.get("type"),
156
- "description": employer.get("description"),
157
- "site_url": employer.get("site_url"),
158
- "area": employer.get("area", {}).get("name"), # город
159
- }
160
167
  # Задержка перед отправкой отклика
161
168
  interval = random.uniform(
162
169
  apply_min_interval, apply_max_interval
@@ -242,7 +249,11 @@ class Operation(BaseOperation):
242
249
  "contacts": vacancy.get(
243
250
  "contacts"
244
251
  ), # пиздорванки там телеграм для связи указывают
245
- "employer_id": int(vacancy["employer"]["id"]),
252
+ # HH с точки зрения перфикциониста — кусок говна, где кривые
253
+ # форматы даты, у вакансий может не быть работодателя...
254
+ "employer_id": int(vacancy["employer"]["id"])
255
+ if "employer" in vacancy and "id" in vacancy["employer"]
256
+ else None,
246
257
  # Остальное неинтересно
247
258
  }
248
259
 
@@ -250,7 +261,9 @@ class Operation(BaseOperation):
250
261
  self, telemetry_client, telemetry_data: defaultdict
251
262
  ) -> None:
252
263
  try:
253
- res = telemetry_client.send_telemetry("/collect", dict(telemetry_data))
264
+ res = telemetry_client.send_telemetry(
265
+ "/collect", dict(telemetry_data)
266
+ )
254
267
  logger.debug(res)
255
268
  except TelemetryError as ex:
256
269
  logger.error(ex)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hh-applicant-tool
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary:
5
5
  Author: Senior YAML Developer
6
6
  Author-email: yamldeveloper@proton.me
@@ -7,7 +7,7 @@ hh_applicant_tool/color_log.py,sha256=gN6j1Ayy1G7qOMI_e3WvfYw_ublzeQbKgsVLhqGg_3
7
7
  hh_applicant_tool/constants.py,sha256=YdNz0CF4swJ9OO5vVpOZ39RP-05xSU0Ghw4Y6BhISoE,468
8
8
  hh_applicant_tool/main.py,sha256=XLKsd8mpCKuFoP3ESMpgJKdGL3m6tOQ8kKrOzCN-dwA,3075
9
9
  hh_applicant_tool/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- hh_applicant_tool/operations/apply_similar.py,sha256=DNvYGbcnyV5LwjIHCOOXWtFEAUgpJHyZFG4Iy2doDJ0,10188
10
+ hh_applicant_tool/operations/apply_similar.py,sha256=V8oLm200m_QCtnjgJ0gY86hBKwec1GDUP8R0Cm5yv_U,10838
11
11
  hh_applicant_tool/operations/authorize.py,sha256=TyUTCSOGwSYVJMEd5vSI981LRRI-RZf8hnlVYhtRVwA,3184
12
12
  hh_applicant_tool/operations/call_api.py,sha256=oWAfvy4LwbsQ8HsgI_3en3sMTlu3ZWU7NzpxssrUNSU,1472
13
13
  hh_applicant_tool/operations/clear_negotiations.py,sha256=5ybdJMUfV9XYxnn2y4zvWdS_ZE8yXAbFJoXOMyqetw8,4041
@@ -18,7 +18,7 @@ hh_applicant_tool/operations/whoami.py,sha256=kdLQ_FjYzpJPKxFlocxf7vgXhW1zocb0bd
18
18
  hh_applicant_tool/telemetry_client.py,sha256=TlsNKlclPyJqLPO0xHkHKBIhT8bmgx1ZBup4PjE8w5E,2296
19
19
  hh_applicant_tool/types.py,sha256=q3yaIcq-UOkPzjxws0OFa4w9fTty-yx79_dic70_dUM,843
20
20
  hh_applicant_tool/utils.py,sha256=wXcxs5IinK7PH6ipCCpngw7faUiboEpi9a8j1wDEPKw,2282
21
- hh_applicant_tool-0.3.3.dist-info/METADATA,sha256=W8nPWVupEP0MLc9K-VOs9E8cEbAMH31jf8gFR0drlF0,15881
22
- hh_applicant_tool-0.3.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
- hh_applicant_tool-0.3.3.dist-info/entry_points.txt,sha256=Vb7M2YaYLMtKYJZh8chIrXZApMzSRFT1-rQw-U9r10g,65
24
- hh_applicant_tool-0.3.3.dist-info/RECORD,,
21
+ hh_applicant_tool-0.3.4.dist-info/METADATA,sha256=0z_iJf0g4i9SGWTLmNd9zlOEGrWV5JonQwoyviXhykM,15881
22
+ hh_applicant_tool-0.3.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
+ hh_applicant_tool-0.3.4.dist-info/entry_points.txt,sha256=Vb7M2YaYLMtKYJZh8chIrXZApMzSRFT1-rQw-U9r10g,65
24
+ hh_applicant_tool-0.3.4.dist-info/RECORD,,