PyS3Uploader 0.4.0b1__py3-none-any.whl → 0.4.0b2__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.
pys3uploader/uploader.py CHANGED
@@ -328,15 +328,29 @@ class Uploader:
328
328
  files_to_upload[file_path] = object_path
329
329
  return files_to_upload
330
330
 
331
- def run(self) -> None:
332
- """Initiates object upload in a traditional loop."""
331
+ def _preflight(self) -> int:
332
+ """Preflight checks and tasks before upload.
333
+
334
+ Returns:
335
+ int:
336
+ Returns the total number of files to be uploaded.
337
+ """
333
338
  # Verify and initiate bucket state
334
339
  self.init()
335
340
  # Verify and initiate local state
336
341
  self.load_local_state()
342
+ # Make sure there are files to upload
343
+ assert self.upload_files, "\n\n\tNo files found to upload.\n"
344
+ # Log size details
337
345
  self.size_it()
346
+ # Start metadata upload timer
338
347
  self.timer.start()
339
- total_files = len(self.upload_files)
348
+ # Return total files to upload
349
+ return len(self.upload_files)
350
+
351
+ def run(self) -> None:
352
+ """Initiates object upload in a traditional loop."""
353
+ total_files = self._preflight()
340
354
 
341
355
  self.logger.info(
342
356
  "%d files from '%s' will be uploaded to '%s' sequentially",
@@ -367,13 +381,7 @@ class Uploader:
367
381
  Args:
368
382
  max_workers: Number of maximum threads to use.
369
383
  """
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)
384
+ total_files = self._preflight()
377
385
 
378
386
  self.logger.info(
379
387
  "%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.0b2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyS3Uploader
3
- Version: 0.4.0b1
3
+ Version: 0.4.0b2
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=iaLsYaqyI4SeRmuQhQWEQpEzaA_U3szloOegj_axp-0,19611
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=FqI7luRfbr03_FdtC3SRipnHn79CZY6AjZYAM2RmRi0,20
11
+ pys3uploader-0.4.0b2.dist-info/LICENSE,sha256=8k-hEraOzyum0GvmmK65YxNRTFXK7eIFHJ0OshJXeTk,1068
12
+ pys3uploader-0.4.0b2.dist-info/METADATA,sha256=yVVlf8rbYL48rOXj6J5mt290xlz0xjhA3f7jO_tY1-Q,9155
13
+ pys3uploader-0.4.0b2.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
14
+ pys3uploader-0.4.0b2.dist-info/top_level.txt,sha256=lVIFMMoUx7dj_myetBmOUQTJiOzz5VyDqchnQElmrWw,13
15
+ pys3uploader-0.4.0b2.dist-info/RECORD,,