talentro-commons 0.19.10__py3-none-any.whl → 0.19.12__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.
@@ -27,8 +27,12 @@ class BucketEnum(StrEnum):
27
27
  class FilePathEnum(StrEnum):
28
28
  IAM_ORGANIZATION_LOGO = "iam/organizations/{organization_id}/details/logo.{extension}"
29
29
  IAM_PROFILE_PICTURE = "iam/users/{user_id}/profile/profile_picture.{extension}"
30
+
31
+ # Candidates
30
32
  CANDIDATES_CANDIDATE_CV_FILE = "organizations/{organization_id}/cand_{candidate_id}/cv/{file_name}"
31
33
  CANDIDATES_CANDIDATE_CV_FOLDER = "organizations/{organization_id}/cand_{candidate_id}/cv/"
34
+
35
+ # DPG
32
36
  SYSTEM_DPG_SYNC = "dpg/last_sync.txt"
33
37
 
34
38
 
@@ -66,7 +70,7 @@ class GoogleStorage(metaclass=SingletonMeta):
66
70
 
67
71
  def _get_bucket(self, bucket: BucketEnum) -> Bucket:
68
72
  try:
69
- bucket = self._client.get_bucket(bucket.value)
73
+ bucket = self._client.get_bucket(f"talentro-{self.env}-{bucket.value}")
70
74
  except NotFound:
71
75
  print(f"Bucket {bucket.value} not found, creating...")
72
76
  bucket = self._client.create_bucket(bucket.value)
@@ -91,13 +95,13 @@ class GoogleStorage(metaclass=SingletonMeta):
91
95
  blob = bucket.blob(filled_destination_path)
92
96
  return blob
93
97
 
94
- def get_blob(self, bucket: BucketEnum, destination: FilePathEnum, path_definitions: dict) -> Blob:
98
+ def get_blob(self, bucket: BucketEnum, destination: FilePathEnum, path_definitions: dict | None = None) -> Blob:
95
99
  """Deletes a blob from the bucket."""
96
100
  blob = self._get_blob(bucket, destination, path_definitions)
97
101
  blob.reload()
98
102
  return blob
99
103
 
100
- def delete_file(self, bucket: BucketEnum, destination: FilePathEnum, path_definitions: dict) -> bool:
104
+ def delete_file(self, bucket: BucketEnum, destination: FilePathEnum, path_definitions: dict | None = None) -> bool:
101
105
  """Deletes a blob from the bucket."""
102
106
  try:
103
107
  blob = self._get_blob(bucket, destination, path_definitions)
@@ -110,7 +114,7 @@ class GoogleStorage(metaclass=SingletonMeta):
110
114
  traceback.print_exc()
111
115
  return False
112
116
 
113
- def delete_folder(self, bucket: BucketEnum, destination: FilePathEnum, path_definitions: dict) -> bool:
117
+ def delete_folder(self, bucket: BucketEnum, destination: FilePathEnum, path_definitions: dict | None = None) -> bool:
114
118
  """Deletes a blob from the bucket."""
115
119
  try:
116
120
  bucket = self._get_bucket(bucket)
@@ -127,7 +131,7 @@ class GoogleStorage(metaclass=SingletonMeta):
127
131
  return False
128
132
 
129
133
  def upload_file(self, file: UploadFile, bucket: BucketEnum, destination: FilePathEnum,
130
- path_definitions: dict) -> Blob:
134
+ path_definitions: dict | None = None) -> Blob:
131
135
  """
132
136
  Uploads a file to Google Storage
133
137
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: talentro-commons
3
- Version: 0.19.10
3
+ Version: 0.19.12
4
4
  Summary: This package contains all globally used code, services, models and data structures for Talentro
5
5
  License: Proprietary
6
6
  Author: Emiel van Essen
@@ -26,7 +26,7 @@ talentro/services/billing.py,sha256=Y2UaQK8lSRa3G8lTZKqLi4t-Jc-EWd7Yn15nR9HOAx8,
26
26
  talentro/services/caching.py,sha256=mmjhXAMJ_g8D8cJqn15YqZ7ST-G5lD9MS-PmlowI7pU,2921
27
27
  talentro/services/clients.py,sha256=vluOrdYdDAQLyGR9-EmogLjA9OUlJtHy0tYD9LhwxKg,2174
28
28
  talentro/services/db.py,sha256=cnKCrYG7GwIu7ZZhA25D-yaXaiCJqPpzfcanWquyrBY,822
29
- talentro/services/google_storage.py,sha256=edol1h4lXshcJSoFr8tUPNR5hX8W619D_cAUTD4-Pyk,5121
29
+ talentro/services/google_storage.py,sha256=UDm3GDHGrYUV0mRK_1zAaagokH8F_wGhNhPyEgpEScw,5231
30
30
  talentro/services/rabbitmq.py,sha256=RNIsLqXM48z5SRRqJ3iWqhRp6FL9TwRwEeii_m8-xDo,6854
31
31
  talentro/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  talentro/util/attributes.py,sha256=PgJnn9LMtHkiNIaMov2HQt5944HweD6gRlAHBZrJGPA,448
@@ -39,6 +39,6 @@ talentro/vacancies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
39
39
  talentro/vacancies/dataclasses.py,sha256=E6H5fsZH4IwtBFSLDolzF6u39tEIrANtWiNVoB65P0c,15074
40
40
  talentro/vacancies/models.py,sha256=GoXr71CNzU6csf8gdmv84etb3Rm-Cdfigp1yqPI_jjQ,4822
41
41
  talentro/vacancies/taxanomy.py,sha256=K3f0yD5g-oxhLXSYNY4WSsGzBfBIb6ngsTDVNGbqO30,6324
42
- talentro_commons-0.19.10.dist-info/METADATA,sha256=eLypP7xaBLwQxtc8ilGhxDOwj2qwch6mQoRiI6RE8RE,1508
43
- talentro_commons-0.19.10.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
44
- talentro_commons-0.19.10.dist-info/RECORD,,
42
+ talentro_commons-0.19.12.dist-info/METADATA,sha256=qxFyRelh2Sff-nm5okPzWydybJn3ffVYHwkGiy9AzKQ,1508
43
+ talentro_commons-0.19.12.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
44
+ talentro_commons-0.19.12.dist-info/RECORD,,