Migrate WebcomicFactory to single-class module.

This commit is contained in:
Tobias Gruetzmacher 2016-05-22 23:40:58 +02:00
parent c62a7283a2
commit 1ea20e1743
2 changed files with 74 additions and 157 deletions

View file

@ -9,162 +9,80 @@ from .common import _WordPressScraper, WP_LATEST_SEARCH
from ..helpers import indirectStarter from ..helpers import indirectStarter
class _WebcomicFactory(_WordPressScraper): class WebcomicFactory(_WordPressScraper):
starter = indirectStarter starter = indirectStarter
latestSearch = WP_LATEST_SEARCH latestSearch = WP_LATEST_SEARCH
def __init__(self, name, url):
super(WebcomicFactory, self).__init__(name)
self.url = url
self.firstStripUrl = url
# do not edit anything below since these entries are generated from @classmethod
# scripts/update_plugins.sh def getmodules(cls):
# START AUTOUPDATE return (
# do not edit anything below since these entries are generated from
# scripts/webcomicfactory.py
class AsTheMayoTurns(_WebcomicFactory): # START AUTOUPDATE
url = 'http://www.thewebcomicfactory.com/comic/as-the-mayo-turns/' cls('AsTheMayoTurns',
firstStripUrl = url 'http://www.thewebcomicfactory.com/comic/as-the-mayo-turns/'),
cls('ComicBookMafia',
'http://www.thewebcomicfactory.com/comic/comic-book-mafia/'),
class ComicBookMafia(_WebcomicFactory): cls('Dealers',
url = 'http://www.thewebcomicfactory.com/comic/comic-book-mafia/' 'http://www.thewebcomicfactory.com/comic/dealers-1-1998-was-the-year/'),
firstStripUrl = url cls('DigitalHobo',
'http://www.thewebcomicfactory.com/comic/digital-hobo-1-its-a-living-kinda/'),
cls('ECoastVsWCoast',
class Dealers(_WebcomicFactory): 'http://www.thewebcomicfactory.com/comic/east-coast-vs-west-coast-greetings-from-the-coasts/'),
url = 'http://www.thewebcomicfactory.com/comic/dealers-1-1998-was-the-year/' cls('GunCulture',
firstStripUrl = url 'http://www.thewebcomicfactory.com/comic/gun-culture/'),
cls('IHateMyKids',
'http://www.thewebcomicfactory.com/comic/i-hate-my-kids/'),
class DigitalHobo(_WebcomicFactory): cls('InARelationship',
url = 'http://www.thewebcomicfactory.com/comic/digital-hobo-1-its-a-living-kinda/' 'http://www.thewebcomicfactory.com/comic/in-a-relationship-3/'),
firstStripUrl = url cls('IntergalacticMedicalDoctor',
'http://www.thewebcomicfactory.com/comic/intergalactic-medical-doctor/'),
cls('JSchoolgirlsInLove',
class ECoastVsWCoast(_WebcomicFactory): 'http://www.thewebcomicfactory.com/comic/japanese-schoolgirls-in-love-1/'),
url = 'http://www.thewebcomicfactory.com/comic/east-coast-vs-west-coast-greetings-from-the-coasts/' cls('KingdomOfTheDwarves',
firstStripUrl = url 'http://www.thewebcomicfactory.com/comic/kingdom-of-the-dwarves/'),
cls('LesterCrenshawIsDead',
'http://www.thewebcomicfactory.com/comic/lester-crenshaw-is-dead/'),
class GunCulture(_WebcomicFactory): cls('Millennials',
url = 'http://www.thewebcomicfactory.com/comic/gun-culture/' 'http://www.thewebcomicfactory.com/comic/millennials/'),
firstStripUrl = url cls('MiserableComedians',
'http://www.thewebcomicfactory.com/comic/miserable-comedians-1-funny-because-its-sad/'),
cls('OldeTymeGamer',
class IHateMyKids(_WebcomicFactory): 'http://www.thewebcomicfactory.com/comic/olde-tyme-gamer-playing-injured/'),
url = 'http://www.thewebcomicfactory.com/comic/i-hate-my-kids/' cls('PinJunkies',
firstStripUrl = url 'http://www.thewebcomicfactory.com/comic/pin-junkies/'),
cls('PostApocalypticNick',
'http://www.thewebcomicfactory.com/comic/post-apocalyptic-nick/'),
class InARelationship(_WebcomicFactory): cls('RealTalk',
url = 'http://www.thewebcomicfactory.com/comic/in-a-relationship-3/' 'http://www.thewebcomicfactory.com/comic/real-talk-people-who-cut-in-line/'),
firstStripUrl = url cls('SoManyNightmares',
'http://www.thewebcomicfactory.com/comic/so-many-nightmares-freedom-nightmare/'),
cls('SportsGuys',
class IntergalacticMedicalDoctor(_WebcomicFactory): 'http://www.thewebcomicfactory.com/comic/sports-guys/'),
url = 'http://www.thewebcomicfactory.com/comic/intergalactic-medical-doctor/' cls('TalesOfPizza',
firstStripUrl = url 'http://www.thewebcomicfactory.com/comic/tales-of-pizza-bad-tipper/'),
cls('TAndA',
'http://www.thewebcomicfactory.com/comic/the-webcomic-factory-premiere-t-and-a/'),
class JSchoolgirlsInLove(_WebcomicFactory): cls('TheAntiwarComic',
url = 'http://www.thewebcomicfactory.com/comic/japanese-schoolgirls-in-love-1/' 'http://www.thewebcomicfactory.com/comic/the-antiwar-comic-the-party/'),
firstStripUrl = url cls('TheGentlemensClub',
'http://www.thewebcomicfactory.com/comic/the-gentlemens-club/'),
cls('TheHorrorOfColony6',
class KingdomOfTheDwarves(_WebcomicFactory): 'http://www.thewebcomicfactory.com/comic/the-horror-of-colony-6-page-1/'),
url = 'http://www.thewebcomicfactory.com/comic/kingdom-of-the-dwarves/' cls('TheKingsOfViralVideo',
firstStripUrl = url 'http://www.thewebcomicfactory.com/comic/the-kings-of-viral-video-premiere/'),
cls('TheSharonAndTonyExperiment',
'http://www.thewebcomicfactory.com/comic/the-sharon-and-tony-experiment/'),
class LesterCrenshawIsDead(_WebcomicFactory): cls('TonyDestructo',
url = 'http://www.thewebcomicfactory.com/comic/lester-crenshaw-is-dead/' 'http://www.thewebcomicfactory.com/comic/tony-destructo/'),
firstStripUrl = url cls('WeirdBikerTales',
'http://www.thewebcomicfactory.com/comic/weird-biker-tales-the-last-outlaw/'),
cls('WillysSpaceDive',
class Millennials(_WebcomicFactory): 'http://www.thewebcomicfactory.com/comic/willys-space-dive/'),
url = 'http://www.thewebcomicfactory.com/comic/millennials/' # END AUTOUPDATE
firstStripUrl = url )
class MiserableComedians(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/miserable-comedians-1-funny-because-its-sad/'
firstStripUrl = url
class OldeTymeGamer(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/olde-tyme-gamer-playing-injured/'
firstStripUrl = url
class PinJunkies(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/pin-junkies/'
firstStripUrl = url
class PostApocalypticNick(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/post-apocalyptic-nick/'
firstStripUrl = url
class RealTalk(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/real-talk-people-who-cut-in-line/'
firstStripUrl = url
class SoManyNightmares(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/so-many-nightmares-freedom-nightmare/'
firstStripUrl = url
class SportsGuys(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/sports-guys/'
firstStripUrl = url
class TalesOfPizza(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/tales-of-pizza-bad-tipper/'
firstStripUrl = url
class TAndA(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/the-webcomic-factory-premiere-t-and-a/'
firstStripUrl = url
class TheAntiwarComic(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/the-antiwar-comic-the-party/'
firstStripUrl = url
class TheGentlemensClub(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/the-gentlemens-club/'
firstStripUrl = url
class TheHorrorOfColony6(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/the-horror-of-colony-6-page-1/'
firstStripUrl = url
class TheKingsOfViralVideo(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/the-kings-of-viral-video-premiere/'
firstStripUrl = url
class TheSharonAndTonyExperiment(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/the-sharon-and-tony-experiment/'
firstStripUrl = url
class TonyDestructo(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/tony-destructo/'
firstStripUrl = url
class WeirdBikerTales(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/weird-biker-tales-the-last-outlaw/'
firstStripUrl = url
class WillysSpaceDive(_WebcomicFactory):
url = 'http://www.thewebcomicfactory.com/comic/willys-space-dive/'
firstStripUrl = url
# END AUTOUPDATE

View file

@ -40,8 +40,7 @@ class WebComicFactoryUpdater(ComicListUpdater):
self.add_comic(name, comicurl) self.add_comic(name, comicurl)
def get_entry(self, name, url): def get_entry(self, name, url):
return (u"class %s(_WebcomicFactory):\n url = %r\n" % (name, url) + return (u"cls('%s',\n '%s')," % (name, url))
u" firstStripUrl = url")
if __name__ == '__main__': if __name__ == '__main__':