From ba8c9baa5413b844f131bd38a8562e5859e44d90 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 01:03:41 +0200 Subject: [PATCH 1/8] doc/frame,shut,step --- spcd/util.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/spcd/util.py b/spcd/util.py index 66fd269..8dda359 100644 --- a/spcd/util.py +++ b/spcd/util.py @@ -42,12 +42,20 @@ def cat(file: Path) -> None: def frame(text: str) -> None: - """Open a new frame in the log output.""" + """Open a new frame in the log output. + + :param text: text to start the frame with + :type text: str + """ log.info("%s%s", env.SPCD_OPEN, text) def shut(text: str) -> None: - """Close current frame in the log output.""" + """Close current frame in the log output. + + :param text: text to shut the frame with + :type text: str + """ log.info("%s%s", env.SPCD_SHUT, text) @@ -57,7 +65,11 @@ def split() -> None: def step(text: str) -> None: - """Increment the step number of the current build process.""" + """Increment the step number of the current build process. + + :param text: text to display + :type text: str + """ shell.STEP += 1 log.info(env.SPCD_DOWN) log.info("%s %s %s", env.SPCD_VERT, shell.STEP, text) From 40bb13c39af534c0cf58084315465b7b68b5fe8f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 01:08:25 +0200 Subject: [PATCH 2/8] doc/browse,cat --- spcd/util.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spcd/util.py b/spcd/util.py index 8dda359..2f8a7ab 100644 --- a/spcd/util.py +++ b/spcd/util.py @@ -19,7 +19,11 @@ def add_url_path(url: str, extra_path: str) -> str: def browse(root: Path) -> None: - """Frame the browsing of a root directory in the log output.""" + """Frame the browsing of a root directory in the log output. + + :param root: directory to browse + :type root: Path + """ paths = [] for directory, _, files in os.walk(root): for file in files: @@ -34,7 +38,11 @@ def browse(root: Path) -> None: def cat(file: Path) -> None: - """Frame the content of a file in the log output.""" + """Frame the content of a file in the log output. + + :param file: file to read the content from + :type file: Path + """ text = str(file) frame(text) log.info(fs.read_file_text(file).rstrip()) From 7251ca35faf79202c0e98d71cae265bfd3664702 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 01:13:18 +0200 Subject: [PATCH 3/8] format --- spcd/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spcd/__init__.py b/spcd/__init__.py index 85fa914..0df38c4 100644 --- a/spcd/__init__.py +++ b/spcd/__init__.py @@ -26,10 +26,13 @@ def clone_project_branch() -> None: split() log.info(project) split() - log.info("""\ + log.info( + """\ %s ↓ -""", project.url) +""", + project.url, + ) run( "git", "clone", From ac72fb13315af418b48170073c2ee4caee237158 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 01:14:52 +0200 Subject: [PATCH 4/8] doc/add_url_path --- spcd/util.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spcd/util.py b/spcd/util.py index 2f8a7ab..73a5309 100644 --- a/spcd/util.py +++ b/spcd/util.py @@ -12,7 +12,15 @@ from spcd.shell import env def add_url_path(url: str, extra_path: str) -> str: - """Append an extra segment to an existing URL.""" + """Append an extra segment to an existing URL. + + :param url: base URL + :type url: str + :param extra_path: path to append + :type extra_path: str + :return: new URL + :rtype: str + """ parts = urlparse(url) parts = parts._replace(path=str(Path(parts.path) / extra_path)) return urlunparse(parts) From 0d1ad96295386732d4243fe55a878caed50416c5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 01:18:03 +0200 Subject: [PATCH 5/8] doc/quiet --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 06f8b3b..103539a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ path = "spcd/__init__.py" [tool.pydoclint] allow-init-docstring = true +quiet = true skip-checking-short-docstrings = false style = "sphinx" From f0aa902904880dc72e52fe1d633b82940e6de1b5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 01:40:27 +0200 Subject: [PATCH 6/8] doc/projects --- spcd/projects.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spcd/projects.py b/spcd/projects.py index 5185feb..c64e3b3 100644 --- a/spcd/projects.py +++ b/spcd/projects.py @@ -35,11 +35,19 @@ class Projects: self.url = add_url_path(value, self.group) def __repr__(self) -> str: - """Represent projects.""" + """Represent projects. + + :return: representation + :rtype: str + """ return "Projects()" def __str__(self) -> str: - """List group, name & url.""" + """List group, name & url. + + :return: string + :rtype: str + """ return f"""\ group = {self.group} name = {self.name} From 4cab5f38945355224c2eb179b57f63c1e30068cb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 21:29:25 +0200 Subject: [PATCH 7/8] =?UTF-8?q?=E2=88=92repr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spcd/project.py | 4 ---- spcd/projects.py | 8 -------- 2 files changed, 12 deletions(-) diff --git a/spcd/project.py b/spcd/project.py index c295d57..6074e0d 100644 --- a/spcd/project.py +++ b/spcd/project.py @@ -45,10 +45,6 @@ class Project: # url self.url = add_url_path(projects.url, self.name) - def __repr__(self) -> str: - """Represent project.""" - return f"Project(projects={self.projects!r})" - def __str__(self) -> str: """List branch, name, root & url.""" return f"""\ diff --git a/spcd/projects.py b/spcd/projects.py index c64e3b3..b09e59b 100644 --- a/spcd/projects.py +++ b/spcd/projects.py @@ -34,14 +34,6 @@ class Projects: if value := self.environment.get(variable, None): self.url = add_url_path(value, self.group) - def __repr__(self) -> str: - """Represent projects. - - :return: representation - :rtype: str - """ - return "Projects()" - def __str__(self) -> str: """List group, name & url. From b3f4cffbca88c4430c5a780577a6b936f5c3c9e2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 16 Sep 2024 21:47:53 +0200 Subject: [PATCH 8/8] =?UTF-8?q?=E2=88=92str?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spcd/project.py | 9 --------- spcd/projects.py | 12 ------------ 2 files changed, 21 deletions(-) diff --git a/spcd/project.py b/spcd/project.py index 6074e0d..8cc8181 100644 --- a/spcd/project.py +++ b/spcd/project.py @@ -44,12 +44,3 @@ class Project: self.root = Path(value) # url self.url = add_url_path(projects.url, self.name) - - def __str__(self) -> str: - """List branch, name, root & url.""" - return f"""\ -branch = {self.branch} - name = {self.name} - root = {self.root} - url = {self.url} -""" diff --git a/spcd/projects.py b/spcd/projects.py index b09e59b..81627e6 100644 --- a/spcd/projects.py +++ b/spcd/projects.py @@ -33,15 +33,3 @@ class Projects: for variable in SERVER_URL: if value := self.environment.get(variable, None): self.url = add_url_path(value, self.group) - - def __str__(self) -> str: - """List group, name & url. - - :return: string - :rtype: str - """ - return f"""\ -group = {self.group} - name = {self.name} - url = {self.url} -"""