Left: | ||
Right: |
OLD | NEW |
---|---|
1 #!@PYTHON@ | 1 #!@PYTHON@ |
2 import sys | 2 import sys |
3 import optparse | 3 import optparse |
4 import os | 4 import os |
5 import math | 5 import math |
6 import re | 6 import re |
7 | 7 |
8 import cgi | 8 import cgi |
9 | 9 |
10 ## so we can call directly as scripts/build/output-distance.py | 10 ## so we can call directly as scripts/build/output-distance.py |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 | 618 |
619 s1 = read_signature_file (f1) | 619 s1 = read_signature_file (f1) |
620 s2 = read_signature_file (f2) | 620 s2 = read_signature_file (f2) |
621 | 621 |
622 link = SystemLink (s1, s2) | 622 link = SystemLink (s1, s2) |
623 | 623 |
624 self.add_system_link (link, system_index[0]) | 624 self.add_system_link (link, system_index[0]) |
625 | 625 |
626 | 626 |
627 def create_images (self, dest_dir): | 627 def create_images (self, dest_dir): |
628 | |
629 files_created = [[], []] | 628 files_created = [[], []] |
630 for oldnew in (0, 1): | 629 for oldnew in (0, 1): |
幹你娘
2019/01/13 02:37:04
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
| |
631 pat = self.base_names[oldnew] + '.eps' | 630 pat = self.base_names[oldnew] + '.eps' |
632 | 631 |
633 for f in glob.glob (pat): | 632 # EPS files generated for regression tests don't contain fonts |
幹你娘
2019/01/13 02:37:04
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
|
幹你娘
2019/01/13 02:37:05
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
|
634 infile = f | 633 # to save disk space. Instead, paths to the fonts are stored in |
幹你娘
2019/01/13 02:37:04
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
| |
635 outfile = (dest_dir + '/' + f).replace ('.eps', '.png') | 634 # the files that are loaded by Ghostscript's `.loadfont' |
幹你娘
2019/01/13 02:37:05
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
my wif
| |
635 # operator later on. | |
636 # | |
637 # In gub builds, these paths get massaged to be relative to the | |
638 # location of the particular EPS files. Since gs doesn't | |
幹你娘
2019/01/13 02:37:05
https://photos.app.goo.gl/KCakjdAeKg6WSURT
| |
639 # provide an option to adjust the font lookup paths for | |
幹你娘
2019/01/13 02:37:04
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
| |
640 # `.loadfont', we enter the directory so that the relative paths | |
幹你娘
2019/01/13 02:37:04
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
幹你娘
2019/01/13 02:37:05
https://photos.app.goo.gl/KCakjdAeKg6WSURT7
| |
641 # are valid. | |
642 (dir, base) = os.path.split (pat) | |
643 | |
644 out_dir = dest_dir + '/' + dir | |
645 mkdir (out_dir) | |
646 | |
647 os.chdir (dir) | |
648 | |
649 for f in glob.glob (base): | |
650 outfile = (out_dir + '/' + f).replace ('.eps', '.png') | |
636 data_option = '' | 651 data_option = '' |
637 if options.local_data_dir: | 652 if options.local_data_dir: |
638 data_option = ('-slilypond-datadir=%s/share/lilypond/current ' | 653 data_option = ('-slilypond-datadir=%s/share/lilypond/current ' |
639 % os.path.dirname(infile)) | 654 % dir) |
640 | 655 |
641 mkdir (os.path.split (outfile)[0]) | |
642 cmd = ('gs' | 656 cmd = ('gs' |
643 ' -sDEVICE=png16m' | 657 ' -sDEVICE=png16m' |
644 ' -dGraphicsAlphaBits=4' | 658 ' -dGraphicsAlphaBits=4' |
645 ' -dTextAlphaBits=4' | 659 ' -dTextAlphaBits=4' |
646 ' %(data_option)s' | 660 ' %(data_option)s' |
647 ' -r101' | 661 ' -r101' |
648 ' -dAutoRotatePages=/None' | 662 ' -dAutoRotatePages=/None' |
649 ' -dPrinted=false' | 663 ' -dPrinted=false' |
650 ' -sOutputFile=%(outfile)s' | 664 ' -sOutputFile=%(outfile)s' |
651 ' -dNOSAFER' | 665 ' -dNOSAFER' |
652 ' -dEPSCrop' | 666 ' -dEPSCrop' |
653 ' -q' | 667 ' -q' |
654 ' -dNOPAUSE' | 668 ' -dNOPAUSE' |
655 ' %(infile)s' | 669 ' %(f)s' |
656 ' -c quit') % locals () | 670 ' -c quit') % locals () |
657 | 671 |
658 files_created[oldnew].append (outfile) | 672 files_created[oldnew].append (outfile) |
659 system (cmd) | 673 system (cmd) |
660 | 674 |
675 os.chdir ('..') | |
676 | |
661 return files_created | 677 return files_created |
662 | 678 |
663 def link_files_for_html (self, dest_dir): | 679 def link_files_for_html (self, dest_dir): |
664 FileLink.link_files_for_html (self, dest_dir) | 680 FileLink.link_files_for_html (self, dest_dir) |
665 to_compare = [[], []] | 681 to_compare = [[], []] |
666 | 682 |
667 exts = [] | 683 exts = [] |
668 if options.create_images: | 684 if options.create_images: |
669 to_compare = self.create_images (dest_dir) | 685 to_compare = self.create_images (dest_dir) |
670 else: | 686 else: |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1350 out = options.output_dir | 1366 out = options.output_dir |
1351 if not out: | 1367 if not out: |
1352 out = args[0].replace ('/', '') | 1368 out = args[0].replace ('/', '') |
1353 out = os.path.join (args[1], 'compare-' + shorten_string (out)) | 1369 out = os.path.join (args[1], 'compare-' + shorten_string (out)) |
1354 | 1370 |
1355 compare_tree_pairs (zip (args[0::2], args[1::2]), out, options.threshold) | 1371 compare_tree_pairs (zip (args[0::2], args[1::2]), out, options.threshold) |
1356 | 1372 |
1357 if __name__ == '__main__': | 1373 if __name__ == '__main__': |
1358 main () | 1374 main () |
1359 | 1375 |
OLD | NEW |