OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 | 2 |
3 import codecs | 3 import codecs |
4 import difflib | 4 import difflib |
5 import errno | 5 import errno |
6 import functools | 6 import functools |
7 import glob | 7 import glob |
8 import html | 8 import html |
9 import math | 9 import math |
10 import optparse | 10 import optparse |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 data_option = '' | 723 data_option = '' |
724 if options.local_data_dir: | 724 if options.local_data_dir: |
725 data_option = ('-slilypond-datadir=%s/share/lilypond/current ' | 725 data_option = ('-slilypond-datadir=%s/share/lilypond/current ' |
726 % abs_dir) | 726 % abs_dir) |
727 | 727 |
728 driver = open('batch.ps', 'w') | 728 driver = open('batch.ps', 'w') |
729 for f in glob.glob (base): | 729 for f in glob.glob (base): |
730 outfile = (out_dir + '/' + f).replace ('.eps', '.png') | 730 outfile = (out_dir + '/' + f).replace ('.eps', '.png') |
731 driver.write(''' | 731 driver.write(''' |
732 mark /OutputFile (%s) | 732 mark /OutputFile (%s) |
| 733 /GraphicsAlphaBits 4 /TextAlphaBits 4 |
| 734 /HWResolution [101 101] |
733 (png16m) finddevice putdeviceprops setdevice | 735 (png16m) finddevice putdeviceprops setdevice |
734 (%s) run | 736 (%s) run |
735 ''' % (outfile, f)) | 737 ''' % (outfile, f)) |
736 files_created[oldnew].append (outfile) | 738 files_created[oldnew].append (outfile) |
737 driver.close() | 739 driver.close() |
738 cmd = ('gs ' | 740 cmd = ('gs ' |
739 ' -dNOSAFER' | 741 ' -dNOSAFER' |
740 ' -dEPSCrop' | 742 ' -dEPSCrop' |
741 ' -q' | 743 ' -q' |
742 ' -dNOPAUSE' | 744 ' -dNOPAUSE' |
743 ' -dNODISPLAY' | 745 ' -dNODISPLAY' |
744 ' -dGraphicsAlphaBits=4' | |
745 ' -dTextAlphaBits=4' | |
746 ' -r101' | |
747 ' -dAutoRotatePages=/None' | 746 ' -dAutoRotatePages=/None' |
748 ' -dPrinted=false' | 747 ' -dPrinted=false' |
749 ' batch.ps' | 748 ' batch.ps' |
750 ' -c quit') | 749 ' -c quit') |
751 system (cmd) | 750 system (cmd) |
752 | 751 |
753 log_verbose ('leaving directory %s' % abs_dir) | 752 log_verbose ('leaving directory %s' % abs_dir) |
754 os.chdir (cur_dir) | 753 os.chdir (cur_dir) |
755 | 754 |
756 return files_created | 755 return files_created |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 | 1551 |
1553 out = options.output_dir | 1552 out = options.output_dir |
1554 if not out: | 1553 if not out: |
1555 out = args[0].replace ('/', '') | 1554 out = args[0].replace ('/', '') |
1556 out = os.path.join (args[1], 'compare-' + shorten_string (out)) | 1555 out = os.path.join (args[1], 'compare-' + shorten_string (out)) |
1557 | 1556 |
1558 compare_tree_pairs (list(zip(args[0::2], args[1::2])), out, options.threshol
d) | 1557 compare_tree_pairs (list(zip(args[0::2], args[1::2])), out, options.threshol
d) |
1559 | 1558 |
1560 if __name__ == '__main__': | 1559 if __name__ == '__main__': |
1561 main () | 1560 main () |
OLD | NEW |