diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-06-07 20:15:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-07 20:15:19 -0400 |
| commit | dbaf923efdd3c57b996254b619d88078798f0de9 (patch) | |
| tree | b71cbbde95a13b6a5064ea2d622a1d23cd9af626 /lib/elements/element.py | |
| parent | d53f2ecaf926828526304248d4508afc416b1296 (diff) | |
| parent | 0ff4f2a61bf295449ae0e7b9fdec75ff19c28771 (diff) | |
Merge pull request #188 from lexelby/lexelby-fix-empty-subpath
fix empty subpath
Diffstat (limited to 'lib/elements/element.py')
| -rw-r--r-- | lib/elements/element.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py index 300136dd..42f6c470 100644 --- a/lib/elements/element.py +++ b/lib/elements/element.py @@ -29,6 +29,10 @@ class Patch: else: raise TypeError("Patch can only be added to another Patch") + def __len__(self): + # This method allows `len(patch)` and `if patch: + return len(self.stitches) + def add_stitch(self, stitch): self.stitches.append(stitch) @@ -36,7 +40,6 @@ class Patch: return Patch(self.color, self.stitches[::-1]) - class Param(object): def __init__(self, name, description, unit=None, values=[], type=None, group=None, inverse=False, default=None, tooltip=None, sort_index=0): self.name = name |
