From c1333ea71b5d619f26e5ada1de2f504c25230f63 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 18 Apr 2019 08:55:20 +0530 Subject: [PATCH] py3: fixes for docx input --- src/calibre/ebooks/docx/block_styles.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/docx/block_styles.py b/src/calibre/ebooks/docx/block_styles.py index 05f5f54692..8594036707 100644 --- a/src/calibre/ebooks/docx/block_styles.py +++ b/src/calibre/ebooks/docx/block_styles.py @@ -11,8 +11,29 @@ from collections import OrderedDict from polyglot.builtins import iteritems -class Inherit: - pass +class Inherit(object): + + def __eq__(self, other): + return other is self + + def __hash__(self): + return id(self) + + def __lt__(self, other): + return False + + def __gt__(self, other): + return other is not self + + def __ge__(self, other): + if self is other: + return True + return True + + def __le__(self, other): + if self is other: + return True + return False inherit = Inherit()