Mail Archives: geda-user/2014/04/17/22:19:43
On Thu, 17 Apr 2014, DJ Delorie wrote:
>> Its great to have a spec but I bet 9/10 people that parse .pcb files
>> aren't ever looking at it, but just working from the file to do what
>> they need.
>
> Given that the file is just a bunch of unlabelled numbers, the only
> way to understand it is to read the spec. So I expect that far more
> people read the spec than you think.
I have few scripts too. Never found the format spec for multiple reasons.
It was relatively straight-forward to reverse engineer it (change one
property, "save as", diff). This is, of course, not the proper way
and if my script would break on a format change while the new format is
still by the spec, I wouldn't blame PCB or the spec. Still, I believe
too, that this is how many people write their scripts for PCB.
I see a really simple solution here: currently PCB saves with predictable
newlines. There could be a command line switch or script option to enforce
it. For current versions this could be dummy, for later versions if anyone
would chnage newline placement he should respect this setting (extra ifs).
There could be a one-liner script pcb-tidy, which would call pcb to
non-interactively load and save a file using this option.
This would convert any legal format to a script-friendly format and
doesn't seem to be much effort on either side. From the scripter's point
of view it's not worse than tidy for html, which is very convenient even
if one uses a real html parser in the next step.
Regards,
Tibor
- Raw text -