diff options
author | jaseg <git@jaseg.de> | 2023-02-19 23:42:17 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-02-19 23:42:17 +0100 |
commit | a374483998baff2fab4c43027c83f8bf97e5fdf5 (patch) | |
tree | 090289b0aa8ea1fe7e425a9d39281cc24e44eae9 /gerbonara/excellon.py | |
parent | f64b03efc752b682b1cbe8cfb114f19e3362ef76 (diff) | |
download | gerbonara-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-x | gerbonara/excellon.py | 19 |
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): |