LEFT | RIGHT |
(no file at all) | |
1 #!@PYTHON@ | 1 #!@PYTHON@ |
2 | 2 |
3 | 3 |
4 ''' | 4 ''' |
5 TODO: | 5 TODO: |
6 | 6 |
7 * Add @nodes, split at sections? | 7 * Add @nodes, split at sections? |
8 | 8 |
9 * -o --output listed in help is not implemented?! | 9 * -o --output listed in help is not implemented?! |
10 ''' | 10 ''' |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 @lilypondfile[%s]{%s} | 148 @lilypondfile[%s]{%s} |
149 """ % (os.path.basename (n), fragment_options, n) | 149 """ % (os.path.basename (n), fragment_options, n) |
150 return s | 150 return s |
151 | 151 |
152 if glob_input: | 152 if glob_input: |
153 files = glob.glob(glob_input) | 153 files = glob.glob(glob_input) |
154 elif input_filename: | 154 elif input_filename: |
155 files = open(input_filename).read().split() | 155 files = open(input_filename).read().split() |
156 | 156 |
157 if files: | 157 if True: |
158 dir = os.path.dirname (name) or "." | 158 dir = os.path.dirname (name) or "." |
159 # don't strip .tely extension, Documentation/snippets uses .itely | 159 # don't strip .tely extension, Documentation/snippets uses .itely |
160 name = os.path.basename (name) | 160 name = os.path.basename (name) |
161 template = template % vars () | 161 template = template % vars () |
162 | 162 |
163 s = "\n".join (map (name2line, files)) | 163 s = "\n".join (map (name2line, files)) |
164 s = template.replace (include_snippets, s, 1) | 164 s = template.replace (include_snippets, s, 1) |
165 f = "%s/%s" % (dir, name) | 165 f = "%s/%s" % (dir, name) |
166 sys.stderr.write ("%s: writing %s..." % (program_name, f)) | 166 sys.stderr.write ("%s: writing %s..." % (program_name, f)) |
167 h = open (f, "w") | 167 h = open (f, "w") |
168 h.write (s) | 168 h.write (s) |
169 h.close () | 169 h.close () |
170 sys.stderr.write ('\n') | 170 sys.stderr.write ('\n') |
171 else: | 171 else: |
172 # not Unix philosophy, but hey, at least we notice when | 172 # not Unix philosophy, but hey, at least we notice when |
173 # we don't distribute any .ly files. | 173 # we don't distribute any .ly files. |
174 sys.stderr.write ("No files specified. Doing nothing") | 174 sys.stderr.write ("No files specified. Doing nothing") |
LEFT | RIGHT |