summaryrefslogtreecommitdiff
path: root/gerbonara/excellon.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-02-19 23:42:17 +0100
committerjaseg <git@jaseg.de>2023-02-19 23:42:17 +0100
commita374483998baff2fab4c43027c83f8bf97e5fdf5 (patch)
tree090289b0aa8ea1fe7e425a9d39281cc24e44eae9 /gerbonara/excellon.py
parentf64b03efc752b682b1cbe8cfb114f19e3362ef76 (diff)
downloadgerbonara-a374483998baff2fab4c43027c83f8bf97e5fdf5.tar.gz
gerbonara-a374483998baff2fab4c43027c83f8bf97e5fdf5.tar.bz2
gerbonara-a374483998baff2fab4c43027c83f8bf97e5fdf5.zip
cli: First draft of most of the CLI
Diffstat (limited to 'gerbonara/excellon.py')
-rwxr-xr-xgerbonara/excellon.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/gerbonara/excellon.py b/gerbonara/excellon.py
index ea5eba4..31ff53f 100755
--- a/gerbonara/excellon.py
+++ b/gerbonara/excellon.py
@@ -207,18 +207,21 @@ class ExcellonFile(CamFile):
def __str__(self):
name = f'{self.original_path.name} ' if self.original_path else ''
+ return f'<ExcellonFile {name}{self.plating_type} with {len(list(self.drills()))} drills, {len(list(self.slots()))} slots using {len(self.drill_sizes())} tools>'
+
+ def __repr__(self):
+ return str(self)
+
+ @property
+ def plating_type(self):
if self.is_plated:
- plating = 'plated'
+ return 'plated'
elif self.is_nonplated:
- plating = 'nonplated'
+ return 'nonplated'
elif self.is_mixed_plating:
- plating = 'mixed plating'
+ return 'mixed plating'
else:
- plating = 'unknown plating'
- return f'<ExcellonFile {name}{plating} with {len(list(self.drills()))} drills, {len(list(self.slots()))} slots using {len(self.drill_sizes())} tools>'
-
- def __repr__(self):
- return str(self)
+ return 'unknown plating'
@property
def is_plated(self):