Skip to content

Commit

Permalink
Merge pull request #4 from chrismaille/develop
Browse files Browse the repository at this point in the history
Release 2.2.1
  • Loading branch information
chrismaille committed Aug 28, 2018
2 parents 4f58a6c + b48e70b commit 366c38b
Show file tree
Hide file tree
Showing 9 changed files with 341 additions and 213 deletions.
6 changes: 3 additions & 3 deletions .idea/runConfigurations/Run_Sphinx.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Run_Tox.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions .idea/runConfigurations/Start_in_3_6.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Test_in_3_6.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

502 changes: 307 additions & 195 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cabrita/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Cabrita initialization."""
__version__ = "2.1.0.rc1"
__version__ = "2.2.1"
23 changes: 19 additions & 4 deletions cabrita/components/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ def includes(self) -> list:
"""
return self.data.get('includes', [])

@property
def show_not_found(self) -> bool:
"""Return if cabrita will display services when containers not found.
:return: bool
"""
return bool(self.data.get('show_not_found', False))

@property
def background_color(self) -> BoxColor:
"""Return the Box Color Enum.
Expand Down Expand Up @@ -298,7 +306,7 @@ def run(self) -> None:

can_skip = self.includes != []
for include in self.includes:
if include in service:
if include.lower() in service:
can_skip = False

if can_skip:
Expand All @@ -309,6 +317,9 @@ def run(self) -> None:
service_name = self._append_ports_in_field("name")
service_status = self._append_ports_in_field("status")

if service_status.lower() == "not found" and not self.show_not_found:
continue

table_data = [
format_color(service_name, self.data_inspected_from_service['style'],
self.data_inspected_from_service['theme']),
Expand Down Expand Up @@ -417,15 +428,19 @@ def format_revision(table_lines: list) -> list:
:return: list
"""
largest_tag = max([
largest_tag = [
len(line[2].split("@")[0] if "@" in line[2] else "")
for line in table_lines
])
]
if largest_tag:
largest_tag = max(largest_tag) # type: ignore
else:
return table_lines

new_lines = []
for line in table_lines:
tag = line[2].split("@")[0] if "@" in line[2] else ""
tag = tag.ljust(largest_tag + 1)
tag = tag.ljust(largest_tag + 1) # type: ignore
tag = formatStr.info(tag, use_prefix=False)
commit_hash = line[2].split("@")[1] if "@" in line[2] else line[2]
commit_hash = formatStr.info(commit_hash, use_prefix=False, theme="dark")
Expand Down
1 change: 0 additions & 1 deletion cabrita/components/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ def _get_container_name(self, service: str, index: int = 1) -> str:
if not name:
# Generate default_name
name = os.path.basename(os.path.dirname(self.compose.full_path))
name = re.sub(r'[^A-Za-z0-9]+', '', name)
name = "{}_{}_{}".format(name.lower(), service.lower(), index)
return name

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ certifi==2018.4.16
chardet==3.0.4
click==6.7
colorama==0.3.9
coverage==4.5.1
coverage==4.0.3
decorator==4.3.0
docopt==0.6.2
docutils==0.14
Expand Down Expand Up @@ -38,6 +38,7 @@ pydashing==1.0.0
pydocstyle==2.1.1
Pygments==2.2.0
pyparsing==2.2.0
python-coveralls==2.9.1
pytz==2018.4
PyYAML==3.12
raven==6.8.0
Expand All @@ -62,4 +63,3 @@ Unidecode==1.0.22
urllib3==1.22
virtualenv==16.0.0
wcwidth==0.1.7
python-coveralls

0 comments on commit 366c38b

Please sign in to comment.