Skip to content

Commit 1a76b38

Browse files
added version property to CombyInterface (fixes #24)
1 parent 86bb6ef commit 1a76b38

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/comby/binary.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ class CombyBinary(CombyInterface):
3131
language: str
3232
The default language that should be assumed when dealing with source
3333
text where no specific language is specified.
34+
version: str
35+
The version of Comby that is used by this binary.
3436
"""
3537
location = attr.ib(type=str, default='comby')
3638
language = attr.ib(type=str, default='.c')
3739

40+
@property
41+
def version(self) -> str:
42+
return self.call('-version').strip()
43+
3844
def call(self, args: str, text: Optional[str] = None) -> str:
3945
"""Calls the Comby binary.
4046

src/comby/interface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@ class CombyInterface(abc.ABC):
1515
1616
Attributes
1717
----------
18+
version: str
19+
The version of Comby that is provided by this interface.
1820
language: str
1921
The default language that should be assumed when dealing with source
2022
text where no specific language is specified.
2123
"""
24+
@property
25+
@abc.abstractmethod
26+
def version(self) -> str:
27+
...
28+
2229
@property
2330
@abc.abstractmethod
2431
def language(self) -> str:

0 commit comments

Comments
 (0)