openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #15901
Re: [Merge] lp:~sfindlay/openlp/refactor-song-import into lp:openlp
409 + formats = filter(lambda f: u'filepathLabel' in self.formatWidgets[f],
410 + SongFormat.get_format_list())
Just a note: using a filter and a lambda is slower than using list comprehension and a ternary operation.
1400 + @staticmethod
1401 + def get(format, *attributes):
While there's nothing wrong with using a static method, in the method above I probably would have used a class method instead:
@classmethod
def get(cls, format, *attributes):
# do stuff with cls instead of SongFormat
cls.__attributes__.get(format)
Lastly, I'm not too hot on camelCase in the dictionary keys, I probably would have gone with_underscores.
--
https://code.launchpad.net/~sfindlay/openlp/refactor-song-import/+merge/109424
Your team OpenLP Core is subscribed to branch lp:openlp.
References