コード例 #1
0
ファイル: TwistedHelRun.py プロジェクト: nothing628/MangaCMS
	def _go(self):
		fl = FeedLoader()
		fl.go()
		fl.closeDB()


		if not runStatus.run:
			return

		cl = ContentLoader()
		cl.go()
		cl.closeDB()


if __name__ == "__main__":
	import utilities.testBase as tb

	with tb.testSetup():
		# run = Runner()
		# run.go()

		runStatus.run = True
		cl = ContentLoader()
		cl.go()
		cl.closeDB()

		# cl = ContentLoader()
		# pg = 'http://www.twistedhelscans.com/read/trace_15/en/0/33/page/1'
		# pg = 'http://www.twistedhelscans.com/read/trace_15/en/0/32/'
		# cl.getImageUrls(pg)
コード例 #2
0
ファイル: FeedLoader.py プロジェクト: oliuz/MangaCMS
            itemList = self.getItemPages(url, title)
            for item in itemList:
                ret.append(item)

            if not runStatus.run:
                self.log.info("Breaking due to exit flag being set")
                break
        self.log.info("Found %s total items", len(ret))
        return ret

    def go(self):

        self.resetStuckItems()
        self.log.info("Getting feed items")

        feedItems = self.getAllItems()
        self.log.info("Processing feed Items")

        self.processLinksIntoDB(feedItems)
        self.log.info("Complete")


if __name__ == "__main__":
    print('wat')

    import utilities.testBase as tb

    with tb.testSetup(startObservers=False):
        cl = FeedLoader()

        cl.go()
コード例 #3
0
ファイル: FeedLoader.py プロジェクト: xiaodoudou/MangaCMS
		return ret



	def setup(self):

		# Muck about in the webget internal settings
		self.wg.errorOutCount = 4
		self.wg.retryDelay    = 5


	def get_feed(self):
		treedata = self.wg.getJson(self.tree_api)
		assert 'contents' in treedata
		assert treedata['name'] == 'mango'
		assert treedata['type'] == 'directory'
		data_unfiltered = self.process_tree_elements(treedata['contents'])
		return data_unfiltered


if __name__ == "__main__":
	import utilities.testBase as tb

	with tb.testSetup(load=False):

		run = FeedLoader()
		# run.go()
		run.do_fetch_feeds()

コード例 #4
0
ファイル: Run.py プロジェクト: GJdan/MangaCMS

from ScrapePlugins.NHentaiLoader.DbLoader import DbLoader
from ScrapePlugins.NHentaiLoader.ContentLoader import ContentLoader

import runStatus

import ScrapePlugins.RunBase

class Runner(ScrapePlugins.RunBase.ScraperBase):


	loggerPath = "Main.Manga.NHentai.Run"
	pluginName = "NHentai"


	sourceName = "NHentai"
	feedLoader = DbLoader
	contentLoader = ContentLoader


if __name__ == "__main__":
	import utilities.testBase as tb

	with tb.testSetup(startObservers=False):
		run = Runner()
		run.go()
コード例 #5
0
ファイル: JaptemMangaRun.py プロジェクト: oliuz/MangaCMS
        fl.go()
        fl.closeDB()

        time.sleep(3)
        #print "wat", cl

        if not runStatus.run:
            return

        cl = ContentLoader()

        if not runStatus.run:
            return

        todo = cl.retreiveTodoLinksFromDB()

        if not runStatus.run:
            return

        cl.processTodoLinks(todo)
        cl.closeDB()


if __name__ == '__main__':
    import utilities.testBase as tb

    with tb.testSetup():
        fl = Runner()

        fl.go()
コード例 #6
0
	@abc.abstractmethod
	def loggerPath(self):
		return None


	def __init__(self):

		self.db = db

		self.log = logging.getLogger("Main.Trigger."+self.loggerPath)
		self.log.info("Loading %s Runner", self.pluginName)


	def _go(self):
		self.log.info("Checking %s for updates", self.pluginName)

		self.go()
		self.log.info("Update check for %s finished.", self.pluginName)




if __name__ == "__main__":
	import utilities.testBase as tb

	with tb.testSetup(startObservers=True):

		run = Runner()
		run.go()

コード例 #7
0
                        starturl=url,
                        netloc=urllib.parse.urlsplit(url).netloc,
                        priority=self.db.DB_HIGH_PRIORITY,
                        distance=0)
                    sess.add(new)
                    sess.commit()

                break

            except sqlalchemy.exc.InternalError:
                self.log.info("Transaction error. Retrying.")
                sess.rollback()
            except sqlalchemy.exc.OperationalError:
                self.log.info("Transaction error. Retrying.")
                sess.rollback()
            except sqlalchemy.exc.IntegrityError:
                self.log.info("Transaction error. Retrying.")
                sess.rollback()
            except sqlalchemy.exc.InvalidRequestError:
                self.log.info("Transaction error. Retrying.")
                sess.rollback()


if __name__ == "__main__":
    import utilities.testBase as tb

    with tb.testSetup(startObservers=True):

        run = Runner()
        run.go()
コード例 #8
0
ファイル: Run.py プロジェクト: gregseb/MangaCMS
def test():
    import utilities.testBase as tb

    with tb.testSetup(startObservers=False):
        run = Runner()
        run.go()
コード例 #9
0
ファイル: Run.py プロジェクト: MyAnimeDays/MangaCMS
def test():
	import utilities.testBase as tb

	with tb.testSetup(startObservers=False):
		run = Runner()
		run.go()
コード例 #10
0
ファイル: DbLoader.py プロジェクト: GDXN/MangaCMS
		items = self.loadFeed(pageOverride)
		ret = []
		for feedEntry in items:
			item = {}

			try:
				item["dlName"] = feedEntry["name"]
				item["contentID"] = feedEntry["token"]
				item["date"] = calendar.timegm(parser.parse( feedEntry["date"]).utctimetuple())
				#self.log.info("date = ", feedEntry['published_parsed'])
				item['retreivalTime'] = time.time()

				ret.append(item)

			except:
				self.log.info("WAT?")
				traceback.print_exc()

		return ret


if __name__ == "__main__":
	import utilities.testBase as tb

	with tb.testSetup(load=False):
		# getHistory()
		run = DjMoeDbLoader()
		# run.getFeed()
		run.go()
コード例 #11
0
def test():
	import utilities.testBase as tb

	with tb.testSetup():
		run = Runner()
		run.go()
コード例 #12
0
ファイル: Run.py プロジェクト: GDXN/MangaCMS
def test():
	import utilities.testBase as tb

	with tb.testSetup():
		run = Runner()
		run.go()