Test Setup Failed
Push — master ( 8ed87e...2c662a )
by Jace
01:17
created

Config.__str__()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
1
from pathlib import Path
2
3
import yorm
4
from yorm.types import String, List, AttributeDictionary
5
6
7
@yorm.attr(name=String)
8
@yorm.attr(command=String)
9
class Environment(AttributeDictionary):
10
11
    def __init__(self, name, command="env"):
12
        super().__init__()
13
        self.name = name
14
        self.command = command
15
16
17
@yorm.attr(files=List.of_type(String))
18
@yorm.attr(environments=List.of_type(Environment))
19
@yorm.sync("{self.root}/{self.filename}", auto_create=False)
20
class Config:
21
22
    def __init__(self, filename="env-diff.yml"):
23
        self.root = Path.cwd()
24
        self.filename = filename
25
        self.files = []
26
        self.environments = []
27
28
    def __str__(self):
29
        return str(self.path)
30
31
    @property
32
    def path(self):
33
        return Path(self.root, self.filename)
34