rename in xml.py only_process_format_tags to parse_and_not_save

This commit is contained in:
Martin Zibricky 2011-09-13 22:40:34 +02:00
parent 8c87d89301
commit 526365153f

View File

@ -345,7 +345,7 @@ class OpenLyrics(object):
self._add_text_to_element(u'line', lines_element, line) self._add_text_to_element(u'line', lines_element, line)
return self._extract_xml(song_xml) return self._extract_xml(song_xml)
def xml_to_song(self, xml, only_process_format_tags=False): def xml_to_song(self, xml, parse_and_not_save=False):
""" """
Create and save a song from OpenLyrics format xml to the database. Since Create and save a song from OpenLyrics format xml to the database. Since
we also export XML from external sources (e. g. OpenLyrics import), we we also export XML from external sources (e. g. OpenLyrics import), we
@ -354,7 +354,7 @@ class OpenLyrics(object):
``xml`` ``xml``
The XML to parse (unicode). The XML to parse (unicode).
``only_process_format_tags`` ``parse_and_not_save``
Switch to skip processing the whole song and to prevent storing the Switch to skip processing the whole song and to prevent storing the
songs to the database. Defaults to ``False``. songs to the database. Defaults to ``False``.
""" """
@ -369,8 +369,8 @@ class OpenLyrics(object):
else: else:
return None return None
if float(song_xml.get(u'version')) > 0.6: if float(song_xml.get(u'version')) > 0.6:
self._process_formatting_tags(song_xml, only_process_format_tags) self._process_formatting_tags(song_xml, parse_and_not_save)
if only_process_format_tags: if parse_and_not_save:
return return
song = Song() song = Song()
# Values will be set when cleaning the song. # Values will be set when cleaning the song.