[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: musicxml merge

From: Juergen Reuter
Subject: Re: musicxml merge
Date: Thu, 13 Sep 2007 16:40:59 +0200 (CEST)

On Thu, 13 Sep 2007, Han-Wen Nienhuys wrote:

2007/9/13, Reinhold Kainhofer <address@hidden>:
+        if filename[-1] == '.':
+            filename += "xml"
+        elif not re.match ("\.xml$", filename):
+            filename += ".xml"

this looks a bit strange.
Do you mean a boolean or here?

No, I'm checking the filename and appending .xml if it's not there (or only
xml if the filename already ends in a "."). The logic is:

If file with given filename exists => Use that filename

both if-bodies are the same. That can't be right.

Isn't the right thing to completely drop the first "if"? If a user really choses a filename that ends with ".", I think the correct behavior is to append ".xml" (rather than just "xml"). For example, imagine a windows user chosing the filename "This is a complete sentence." If you only append "xml", the dot will disappear from the filename that is displayed to the user in the windows GUI. I think, the correct full filename should in this case be "This is a complete sentence..xml". Or do I miss something?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]