roskakori / cutplace

validate data stored in CSV, PRN, ODS or Excel files
http://cutplace.readthedocs.org/
GNU Lesser General Public License v3.0
18 stars 20 forks source link

Cleanup InputLocation #65

Closed heubi95 closed 9 years ago

heubi95 commented 10 years ago
roskakori commented 10 years ago

Hints on implementing __eg__ and __lt__: http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/

Rough implementation of InputLocation.__lt__():

    def __lt__(self, other):
        return (self.filePath < other.filePath) \
            and (self.line < other.line) \
            and (not self._hasColumn or (self.column < other.column)) \
            and (not self._hasCell or (self.cell < other.cell)) \
            and (not self._hasSheet or (self.sheet < other.sheet))