PyS3Uploader 0.4.0b1__py3-none-any.whl → 0.4.1a0__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 PyS3Uploader might be problematic. Click here for more details.

pys3uploader/uploader.py CHANGED
@@ -74,6 +74,7 @@ class Uploader:
74
74
  profile_name: AWS profile name.
75
75
  aws_access_key_id: AWS access key ID.
76
76
  aws_secret_access_key: AWS secret access key.
77
+ retry_config: Boto3 retry configuration.
77
78
  logger: Bring your own logger.
78
79
  log_handler: Default log handler, can be ``file`` or ``stdout``.
79
80
  log_level: Default log level, can be ``debug``, ``info``, ``warning`` or ``error``.
@@ -267,6 +268,7 @@ class Uploader:
267
268
  "S3 object %s exists, but size mismatch. Local: [%d bytes / %s], S3: [%d bytes / %s]",
268
269
  objectpath,
269
270
  file_size,
271
+ size_converter(file_size),
270
272
  object_size,
271
273
  size_converter(object_size),
272
274
  )
@@ -328,15 +330,29 @@ class Uploader:
328
330
  files_to_upload[file_path] = object_path
329
331
  return files_to_upload
330
332
 
331
- def run(self) -> None:
332
- """Initiates object upload in a traditional loop."""
333
+ def _preflight(self) -> int:
334
+ """Preflight checks and tasks before upload.
335
+
336
+ Returns:
337
+ int:
338
+ Returns the total number of files to be uploaded.
339
+ """
333
340
  # Verify and initiate bucket state
334
341
  self.init()
335
342
  # Verify and initiate local state
336
343
  self.load_local_state()
344
+ # Make sure there are files to upload
345
+ assert self.upload_files, "\n\n\tNo files found to upload.\n"
346
+ # Log size details
337
347
  self.size_it()
348
+ # Start metadata upload timer
338
349
  self.timer.start()
339
- total_files = len(self.upload_files)
350
+ # Return total files to upload
351
+ return len(self.upload_files)
352
+
353
+ def run(self) -> None:
354
+ """Initiates object upload in a traditional loop."""
355
+ total_files = self._preflight()
340
356
 
341
357
  self.logger.info(
342
358
  "%d files from '%s' will be uploaded to '%s' sequentially",
@@ -367,13 +383,7 @@ class Uploader:
367
383
  Args:
368
384
  max_workers: Number of maximum threads to use.
369
385
  """
370
- # Verify and initiate bucket state
371
- self.init()
372
- # Verify and initiate local state
373
- self.load_local_state()
374
- self.size_it()
375
- self.timer.start()
376
- total_files = len(self.upload_files)
386
+ total_files = self._preflight()
377
387
 
378
388
  self.logger.info(
379
389
  "%d files from '%s' will be uploaded to '%s' with maximum concurrency of: %d",
pys3uploader/version.py CHANGED
@@ -1 +1 @@
1
- version = "0.4.0b1"
1
+ version = "0.4.1a0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyS3Uploader
3
- Version: 0.4.0b1
3
+ Version: 0.4.1a0
4
4
  Summary: Python module to upload objects to an S3 bucket.
5
5
  Author-email: Vignesh Rao <svignesh1793@gmail.com>
6
6
  License: MIT License
@@ -5,11 +5,11 @@ pys3uploader/metadata.py,sha256=4pn8Y9dVZLFXxq5Cocm20t1mfDkV5xJXY6YEekQ8ssQ,231
5
5
  pys3uploader/progress.py,sha256=IladNMXLBhkPpxOntpANTam_hC9OWosmNDmdbweDNYM,1195
6
6
  pys3uploader/timer.py,sha256=8tvlQaO1Z7TfFVBhl5qrDq9wsMiOR6P0J2bkVwfM96c,1816
7
7
  pys3uploader/tree.py,sha256=DiQ2ekMMaj2m_P3-iKkEqSuJCJZ_UZxcAwHtAoPVa5c,1824
8
- pys3uploader/uploader.py,sha256=Bt2agHNEPAQU4_gCWr9UkQnFmsvN1XA5mv6C_A9CP8o,19354
8
+ pys3uploader/uploader.py,sha256=sKUcC5eFL_NPYoYi3FWUWRCwkjoW2OXlcozNP9OIrzM,19707
9
9
  pys3uploader/utils.py,sha256=8eIM5ZhS7-bYT5Dq4FNbmojQ16vvoAPF1ihCCTZezGE,5783
10
- pys3uploader/version.py,sha256=LbK2ZtjMqQY-aqhvblfIlZsvOYPfoOZ1bAnW5Cno4DY,20
11
- pys3uploader-0.4.0b1.dist-info/LICENSE,sha256=8k-hEraOzyum0GvmmK65YxNRTFXK7eIFHJ0OshJXeTk,1068
12
- pys3uploader-0.4.0b1.dist-info/METADATA,sha256=-LG36ZcYpnRfCzAFwkRygT78hwCteQAHRL2CmEUGGkk,9155
13
- pys3uploader-0.4.0b1.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
14
- pys3uploader-0.4.0b1.dist-info/top_level.txt,sha256=lVIFMMoUx7dj_myetBmOUQTJiOzz5VyDqchnQElmrWw,13
15
- pys3uploader-0.4.0b1.dist-info/RECORD,,
10
+ pys3uploader/version.py,sha256=t9lIxi0skPjuG6f_lIZ9Hx9gXs5mbdbnIuC5KLIMc-Y,20
11
+ pys3uploader-0.4.1a0.dist-info/LICENSE,sha256=8k-hEraOzyum0GvmmK65YxNRTFXK7eIFHJ0OshJXeTk,1068
12
+ pys3uploader-0.4.1a0.dist-info/METADATA,sha256=m4P0H49F97neV8LFFUOfASBHEmHGip3Ck-Yj4kvdbkU,9155
13
+ pys3uploader-0.4.1a0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
14
+ pys3uploader-0.4.1a0.dist-info/top_level.txt,sha256=lVIFMMoUx7dj_myetBmOUQTJiOzz5VyDqchnQElmrWw,13
15
+ pys3uploader-0.4.1a0.dist-info/RECORD,,