Created
December 18, 2016 12:09
-
-
Save dmugtasimov/034eb464905d479b250ad75c442ca24f to your computer and use it in GitHub Desktop.
Solution to exclude base class from registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
Spider | |
except NameError: | |
# Spider name is not known yet so we are either | |
# initializing Spider class or we are initializing | |
# some class that is not inherited from Spider | |
# This mean that we do not need to add this class | |
# to registry | |
pass | |
else: | |
spider_registry.add_spider_class(cls) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment