]> git.donarmstrong.com Git - lilypond.git/commitdiff
make regularize_id globally visible.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 21 Jan 2007 12:52:00 +0000 (13:52 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 22 Jan 2007 17:31:27 +0000 (18:31 +0100)
python/convertrules.py

index 321de20a209fab65b20cadbfde5fed48295100aa..457309dc27e829c7c0b509128fa4921bd7d0a747 100644 (file)
@@ -604,24 +604,25 @@ def conv (str):
     return str
 
 conversions.append (((1,3,113), conv, 'LyricVoice -> LyricsVoice'))
+def regularize_id (str):
+    s = ''
+    lastx = ''
+    for x in str:
+        if x == '_':
+            lastx = x
+            continue
+        elif x in string.digits:
+            x = chr(ord (x) - ord ('0')  +ord ('A'))
+        elif x not in string.letters:
+            x = 'x'
+        elif x in string.lowercase and lastx == '_':
+            x = string.upper (x)
+        s = s + x
+        lastx = x
+    return s
 
 def conv (str):
-    def regularize_id (str):
-       s = ''
-       lastx = ''
-       for x in str:
-           if x == '_':
-               lastx = x
-               continue
-           elif x in string.digits:
-               x = chr(ord (x) - ord ('0')  +ord ('A'))
-           elif x not in string.letters:
-               x = 'x'
-           elif x in string.lowercase and lastx == '_':
-               x = string.upper (x)
-           s = s + x
-           lastx = x
-       return s
+
 
     def regularize_dollar_reference (match):
        return regularize_id (match.group (1))