atomicshop 3.1.9__py3-none-any.whl → 3.1.11__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 atomicshop might be problematic. Click here for more details.

atomicshop/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """Atomic Basic functions and classes to make developer life easier"""
2
2
 
3
3
  __author__ = "Den Kras"
4
- __version__ = '3.1.9'
4
+ __version__ = '3.1.11'
@@ -389,12 +389,12 @@ class GitHubWrapper:
389
389
  """
390
390
  return self.get_the_latest_release_json()['tag_name']
391
391
 
392
- def get_latest_commit_comment(self):
392
+ def get_latest_commit(self) -> dict:
393
393
  """
394
- This function retrieves the commit message (comment) of the latest commit on the specified branch.
394
+ This function retrieves the latest commit on the specified branch.
395
395
  It uses the GitHub API endpoint for commits.
396
396
 
397
- :return: str, the commit message of the latest commit.
397
+ :return: dict, the latest commit data.
398
398
  """
399
399
 
400
400
  headers: dict = self._get_headers()
@@ -413,9 +413,22 @@ class GitHubWrapper:
413
413
 
414
414
  commits = response.json()
415
415
  if not commits:
416
- return None
416
+ return {}
417
+
418
+ latest_commit = commits[0]
419
+ return latest_commit
420
+
421
+ def get_latest_commit_message(self):
422
+ """
423
+ This function retrieves the commit message (comment) of the latest commit on the specified branch.
424
+ It uses the GitHub API endpoint for commits.
417
425
 
418
- commit_message = commits[0].get("commit", {}).get("message", "")
426
+ :return: str, the commit message of the latest commit.
427
+ """
428
+
429
+ latest_commit: dict = self.get_latest_commit()
430
+
431
+ commit_message = latest_commit.get("commit", {}).get("message", "")
419
432
  return commit_message
420
433
 
421
434
 
@@ -432,7 +445,7 @@ def parse_github_args():
432
445
  parser.add_argument(
433
446
  '-p', '--path', type=str, default=None,
434
447
  help="The path to the file/folder inside the repo that we'll do certain actions on.\n"
435
- "Available actions: get_latest_commit_comment, download_path_from_branch.")
448
+ "Available actions: get_latest_commit_message, download_path_from_branch.")
436
449
  parser.add_argument(
437
450
  '-t', '--target_directory', type=str, default=None,
438
451
  help='The target directory to download the file/folder.'
@@ -441,8 +454,11 @@ def parse_github_args():
441
454
  '--pat', type=str, default=None,
442
455
  help='The personal access token to the repo.')
443
456
  parser.add_argument(
444
- '-glcc', '--get_latest_commit_comment', action='store_true', default=False,
445
- help='Sets if the latest commit comment will be printed.')
457
+ '-glcm', '--get_latest_commit_message', action='store_true', default=False,
458
+ help='Sets if the latest commit message comment will be printed.')
459
+ parser.add_argument(
460
+ '-glcj', '--get_latest_commit_json', action='store_true', default=False,
461
+ help='Sets if the latest commit json will be printed.')
446
462
  parser.add_argument(
447
463
  '-db', '--download_branch', action='store_true', default=False,
448
464
  help='Sets if the branch will be downloaded. In conjunction with path, only the path will be downloaded.')
@@ -456,7 +472,8 @@ def github_wrapper_main(
456
472
  path: str = None,
457
473
  target_directory: str = None,
458
474
  pat: str = None,
459
- get_latest_commit_comment: bool = False,
475
+ get_latest_commit_json: bool = False,
476
+ get_latest_commit_message: bool = False,
460
477
  download_branch: bool = False
461
478
  ):
462
479
  """
@@ -467,7 +484,8 @@ def github_wrapper_main(
467
484
  :param path: str, the path to the file/folder for which the commit message should be retrieved.
468
485
  :param target_directory: str, the target directory to download the file/folder.
469
486
  :param pat: str, the personal access token to the repo.
470
- :param get_latest_commit_comment: bool, sets if the latest commit comment will be printed.
487
+ :param get_latest_commit_json: bool, sets if the latest commit json will be printed.
488
+ :param get_latest_commit_message: bool, sets if the latest commit message comment will be printed.
471
489
  :param download_branch: bool, sets if the branch will be downloaded. In conjunction with path, only the path will be
472
490
  downloaded.
473
491
  :return:
@@ -475,11 +493,16 @@ def github_wrapper_main(
475
493
 
476
494
  git_wrapper = GitHubWrapper(repo_url=repo_url, branch=branch, path=path, pat=pat)
477
495
 
478
- if get_latest_commit_comment:
479
- commit_comment = git_wrapper.get_latest_commit_comment()
496
+ if get_latest_commit_message:
497
+ commit_comment = git_wrapper.get_latest_commit_message()
480
498
  print_api(commit_comment)
481
499
  return 0
482
500
 
501
+ if get_latest_commit_json:
502
+ latest_commit_json = git_wrapper.get_latest_commit()
503
+ print_api(latest_commit_json)
504
+ return 0
505
+
483
506
  if download_branch:
484
507
  git_wrapper.download_and_extract_branch(
485
508
  target_directory=target_directory, download_each_file=False, archive_remove_first_directory=True)
@@ -496,6 +519,7 @@ def github_wrapper_main_with_args():
496
519
  path=args.path,
497
520
  target_directory=args.target_directory,
498
521
  pat=args.pat,
499
- get_latest_commit_comment=args.get_latest_commit_comment,
522
+ get_latest_commit_json=args.get_latest_commit_json,
523
+ get_latest_commit_message=args.get_latest_commit_message,
500
524
  download_branch=args.download_branch
501
525
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 3.1.9
3
+ Version: 3.1.11
4
4
  Summary: Atomic functions and classes to make developer life easier
5
5
  Author: Denis Kras
6
6
  License: MIT License
@@ -49,7 +49,7 @@ Requires-Dist: pandas
49
49
  Requires-Dist: paramiko
50
50
  Requires-Dist: pefile
51
51
  Requires-Dist: playwright
52
- Requires-Dist: playwright-stealth
52
+ Requires-Dist: playwright-stealth ==1.0.6
53
53
  Requires-Dist: protobuf
54
54
  Requires-Dist: psutil
55
55
  Requires-Dist: py7zr ==0.22.0
@@ -1,4 +1,4 @@
1
- atomicshop/__init__.py,sha256=EQJIgq1QRIHAmPvbH_Qo_f07M3JEn4xL2sUgoWRi8Q4,122
1
+ atomicshop/__init__.py,sha256=8u6hiKXHeheb_YkAYlFORxMIiYuSzHr0do9YConmyXA,123
2
2
  atomicshop/_basics_temp.py,sha256=6cu2dd6r2dLrd1BRNcVDKTHlsHs_26Gpw8QS6v32lQ0,3699
3
3
  atomicshop/_create_pdf_demo.py,sha256=Yi-PGZuMg0RKvQmLqVeLIZYadqEZwUm-4A9JxBl_vYA,3713
4
4
  atomicshop/_patch_import.py,sha256=ENp55sKVJ0e6-4lBvZnpz9PQCt3Otbur7F6aXDlyje4,6334
@@ -197,7 +197,7 @@ atomicshop/wrappers/astw.py,sha256=VkYfkfyc_PJLIOxByT6L7B8uUmKY6-I8XGZl4t_z828,4
197
197
  atomicshop/wrappers/configparserw.py,sha256=JwDTPjZoSrv44YKwIRcjyUnpN-FjgXVfMqMK_tJuSgU,22800
198
198
  atomicshop/wrappers/cryptographyw.py,sha256=LfzTnwvJE03G6WZryOOf43VKhhnyMakzHpn8DPPCoy4,13252
199
199
  atomicshop/wrappers/ffmpegw.py,sha256=wcq0ZnAe0yajBOuTKZCCaKI7CDBjkq7FAgdW5IsKcVE,6031
200
- atomicshop/wrappers/githubw.py,sha256=vaVQg0pkHY63_TfIbCoWmHDPtI2rDPAqMYwsOl3GN78,22559
200
+ atomicshop/wrappers/githubw.py,sha256=DrFF_oN-rulPQV1iKgVzZadCjuYuCC5eKAjZp_3YD0g,23476
201
201
  atomicshop/wrappers/msiw.py,sha256=GQLqud72nfex3kvO1bJSruNriCYTYX1_G1gSf1MPkIA,6118
202
202
  atomicshop/wrappers/netshw.py,sha256=8WE_576XiiHykwFuE-VkCx5CydMpFlztX4frlEteCtI,6350
203
203
  atomicshop/wrappers/numpyw.py,sha256=sBV4gSKyr23kXTalqAb1oqttzE_2XxBooCui66jbAqc,1025
@@ -337,8 +337,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=WcNyaqEZ82S5-f3kzqi1nllNT2N
337
337
  atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
338
338
  atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
339
339
  atomicshop/wrappers/winregw/winreg_network.py,sha256=ih0BVNwByLvf9F_Lac4EdmDYYJA3PzMvmG0PieDZrsE,9905
340
- atomicshop-3.1.9.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
341
- atomicshop-3.1.9.dist-info/METADATA,sha256=-CO4-bPxF4SKM5Gi0aC0Sbqkl0s974zx0o5bR5gnBWE,10662
342
- atomicshop-3.1.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
343
- atomicshop-3.1.9.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
344
- atomicshop-3.1.9.dist-info/RECORD,,
340
+ atomicshop-3.1.11.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
341
+ atomicshop-3.1.11.dist-info/METADATA,sha256=nanoa0C9_fa9ZwN1zyJxq_IsjcXhUGGWVSzn5Hm8AZQ,10671
342
+ atomicshop-3.1.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
343
+ atomicshop-3.1.11.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
344
+ atomicshop-3.1.11.dist-info/RECORD,,