# Note: gettext work best if we use ' for docstrings and "
-# for gettextable strings
+# for gettextable strings.
+# --> DO NOT USE """ for docstrings.
'''
TODO:
return s
-layout_fields = ['title', 'subtitle', 'subsubtitle', 'footer', 'head',
- 'composer', 'arranger', 'instrument', 'opus', 'piece', 'metre',
- 'meter', 'poet']
+layout_fields = ['dedication', 'title', 'subtitle', 'subsubtitle',
+ 'footer', 'head', 'composer', 'arranger', 'instrument',
+ 'opus', 'piece', 'metre', 'meter', 'poet', 'texttranslator']
# init to empty; values here take precedence over values in the file
original_dir = os.getcwd ()
-temp_dir = '%s.dir' % program_name
+temp_dir = os.path.join (original_dir, '%s.dir' % program_name)
+
keep_temp_dir_p = 0
verbose_p = 0
def error (s):
- """Report the error S. Exit by raising an exception. Please
+ '''Report the error S. Exit by raising an exception. Please
do not abuse by trying to catch this error. If you donn't want
a stack trace, write to the output directly.
None
- """
+ '''
progress (_ ("error: ") + s)
raise _ ("Exiting ... ")
os.mkdir (temp_dir, 0777)
except OSError:
pass
-
+
return temp_dir
if ( os.name != 'posix' ):
cmd = re.sub (r'''\\''', r'''\\\\\\''', cmd)
cmd = "sh -c \'%s\'" % cmd
+
+
if verbose_p:
progress (_ ("Invoking `%s\'") % cmd)
st = os.system (cmd)
files = map (lambda x: strip_extension (x, '.ly'), files)
+ (outdir, outbase) = ('','')
if not output_name:
- output_name = os.path.basename (files[0])
+ outbase = os.path.basename (files[0])
+ outdir = abspath('.')
+ elif output_name[-1] == os.sep:
+ outdir = abspath (output_name)
+ outbase = os.path.basename (files[0])
+ else:
+ (outdir, outbase) = os.path.split (abspath (output_name))
for i in ('.dvi', '.latex', '.ly', '.ps', '.tex'):
output_name = strip_extension (output_name, i)
dep_prefix = 0
reldir = os.path.dirname (output_name)
-
- (outdir, outbase) = os.path.split (abspath (output_name))
if outdir != '.' and (track_dependencies_p or targets.keys ()):
mkdir_p (outdir, 0777)