Ejemplo n.º 1
0
def main():
    """Do the actual work of the script"""
    print('')
    print('buildglyphimages.py,')
    print('Part of lilyglyphs.')
    print('')
    
    # set CWD and ensure the necessary subdirs are present
    check_paths()
    print('')

    # load and parse input file
    lg.read_input_file(in_file)
    read_entries()
    print('')

    # generate LilyPond source files for each command
    # and compile them
    write_lily_src_files()
    print('')
    lg.compile_lily_files()
    print('')
    
    # remove intermediate files and move pdfs to pdf directory
    lg.cleanup_lily_files()
    print('')
    
    # generate latex commands and example code
    # and write them to the output file
    lg.generate_latex_commands()
    print('')
    write_latex_file()
Ejemplo n.º 2
0
def main():

    print 'rebuild-pdfs.py'
    print 'regenerate all pdf images that are not present (anymore)'
    
    print ''
    check_paths()

    print ''
    src_files = lg.check_missing_pdfs()
    # is there anything to be done at all?
    if len(src_files) == 0:
        print ''
        print 'No image files missing, nothing to be done.'
        print 'If you want to re-create pdfs, then delete them first'
        sys.exit(0)
    lg.lily_files = src_files
    print ''
    print 'Found ' + str(len(src_files)) + ' missing file(s).'
    
    # compile all LilyPond files without matching pdf
    lg.compile_lily_files()
    
    # clean up directories
    lg.cleanup_lily_files()
Ejemplo n.º 3
0
def main():
    """Main walk through the program"""
    print 'rebuild-pdfs.py'
    print 'regenerate all pdf images that are not present (anymore)'
    print ''
    
    # Check if we are in a legal CWD and ensure a PDF subdir is present
    check_paths()

    # build a list of commands with missing PDF files
    src_files = check_missing_pdfs()

    # is there anything to be done at all?
    if len(src_files) == 0:
        print ''
        print 'No image files missing, nothing to be done.'
        print 'If you want to re-create pdfs, then delete them first'
        sys.exit(0)
    print ''
    print 'Found ' + str(len(src_files)) + ' missing file(s).'
    for cmd in src_files:
        print '- ' + cmd

    # compile all LilyPond files without matching pdf
    lg.lily_files = src_files
    lg.compile_lily_files()
    
    # clean up directories
    lg.cleanup_lily_files()
Ejemplo n.º 4
0
def main():
    """Do the actual work of the script"""
    print ""
    print "buildglyphimages.py,"
    print "Part of lilyglyphs."
    print ""

    # set CWD and ensure the necessary subdirs are present
    check_paths()
    print ""

    # load and parse input file
    lg.read_input_file(in_file)
    read_entries()
    print ""

    # generate LilyPond source files for each command
    # and compile them
    write_lily_src_files()
    print ""
    lg.compile_lily_files()
    print ""

    # remove intermediate files and move pdfs to pdf directory
    lg.cleanup_lily_files()
    print ""

    # generate latex commands and example code
    # and write them to the output file
    lg.generate_latex_commands()
    print ""
    write_latex_file()
Ejemplo n.º 5
0
def main():
    """Main walk through the program"""
    print 'rebuild-pdfs.py'
    print 'regenerate all pdf images that are not present (anymore)'
    print ''
    
    # Check if we are in a legal CWD and ensure a PDF subdir is present
    check_paths()

    # build a list of commands with missing PDF files
    src_files = check_missing_pdfs()

    # is there anything to be done at all?
    if len(src_files) == 0:
        print ''
        print 'No image files missing, nothing to be done.'
        print 'If you want to re-create pdfs, then delete them first'
        sys.exit(0)
    print ''
    print 'Found ' + str(len(src_files)) + ' missing file(s).'
    for cmd in src_files:
        print '- ' + cmd

    # compile all LilyPond files without matching pdf
    lg.lily_files = src_files
    lg.compile_lily_files()
    
    # clean up directories
    lg.cleanup_lily_files()
Ejemplo n.º 6
0
def main(argv):
    global flag_force, definitions_file_name
    short_options = 'i:'
    long_options = []
    long_options.append('input=')
    try:
        opts, args = getopt.getopt(argv, short_options, long_options)
        for opt, arg in opts:
            if opt in ("-i",  "--input"):
                lg.input_files.append(arg)
            else:
                usage()
                sys.exit(2)
    except getopt.GetoptError:
        usage()
        sys.exit(2)

    # Do the actual work of the script
    print ''
    print 'buildglyphimages.py,'
    print 'Part of lilyglyphs.'

    print ''
    check_paths()

    for input_file_name in lg.input_files:
        print ''
        lg.read_input_file('definitions/' + input_file_name)

        basename, dummy = os.path.splitext(input_file_name)
        lg.cat_subdir = basename + '/'

        print ''
        read_entries()

        print ''
        write_lily_src_files()

        print ''
        lg.compile_lily_files()

        print ''
        lg.generate_latex_commands()

    print ''
    lg.cleanup_lily_files()

    print ''
    write_latex_file()