From eb3b0616e04928b4f007a500a0a35a0213c7c13e Mon Sep 17 00:00:00 2001 From: Vitor Lobo Ramos Date: Sat, 14 Apr 2018 22:57:31 -0300 Subject: [PATCH 1/3] Documenting some functions and methods that are difficult to understand. --- Atomic/atomic.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Atomic/atomic.py b/Atomic/atomic.py index 2b1e3a53..1f106aff 100644 --- a/Atomic/atomic.py +++ b/Atomic/atomic.py @@ -13,7 +13,13 @@ from docker.errors import NotFound from .discovery import RegistryInspect, RegistryInspectError + + def find_repo_tag(d, Id, image_name): + + # The image_in_repotags function fetches the name of the image inside the "repotag" repository, and if it finds, + # returns the name of the image, or image list. + def image_in_repotags(image_name, repotags): if image_name in repotags: return image_name @@ -118,6 +124,11 @@ def pull(self): prevstatus = status util.write_out("") + # If for some reason the NameError or AtributeError class appears in the path, + # the exception is thrown to ignore the "pass" problem. + # The NameError class handles only unqualified names while AtributeError, + # appears when an object does not support attribute references or assignments. + def set_args(self, args): self.args = args try: From f22d27fc8e2986dcb2cad5584501101240a01842 Mon Sep 17 00:00:00 2001 From: Vitor Lobo Ramos Date: Mon, 16 Apr 2018 16:46:25 -0300 Subject: [PATCH 2/3] Some corrections --- Atomic/atomic.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Atomic/atomic.py b/Atomic/atomic.py index 1f106aff..39cc581a 100644 --- a/Atomic/atomic.py +++ b/Atomic/atomic.py @@ -14,10 +14,9 @@ from .discovery import RegistryInspect, RegistryInspectError - def find_repo_tag(d, Id, image_name): - # The image_in_repotags function fetches the name of the image inside the "repotag" repository, and if it finds, + # The image_in_repotags function fetches the name of the image inside the "repotag" repository, and if found, # returns the name of the image, or image list. def image_in_repotags(image_name, repotags): @@ -124,7 +123,7 @@ def pull(self): prevstatus = status util.write_out("") - # If for some reason the NameError or AtributeError class appears in the path, + # If for some reason the NameError or AttributeError class appears in the path, # the exception is thrown to ignore the "pass" problem. # The NameError class handles only unqualified names while AtributeError, # appears when an object does not support attribute references or assignments. @@ -229,6 +228,11 @@ def _get_args(self, label): def quote(self, args): return list(map(pipes.quote, args)) + + # This function cmd_env adds the atomic project environment variables within a dictionary (key and value), + # and reassigns some of its values as image and image name. + # The goal here is to return the argument, with expanded environment variables and return new newenv. + def cmd_env(self): newenv = dict(os.environ) newenv['NAME'] = self.name or "" From fac36b37c01b8f1299491468bad6f0d4b7df436c Mon Sep 17 00:00:00 2001 From: Vitor Lobo Ramos Date: Mon, 16 Apr 2018 16:51:23 -0300 Subject: [PATCH 3/3] Some corrections --- Atomic/atomic.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Atomic/atomic.py b/Atomic/atomic.py index 39cc581a..012c9c31 100644 --- a/Atomic/atomic.py +++ b/Atomic/atomic.py @@ -228,7 +228,6 @@ def _get_args(self, label): def quote(self, args): return list(map(pipes.quote, args)) - # This function cmd_env adds the atomic project environment variables within a dictionary (key and value), # and reassigns some of its values as image and image name. # The goal here is to return the argument, with expanded environment variables and return new newenv.