mirror of
https://github.com/simon987/od-database.git
synced 2025-04-19 02:16:47 +00:00
od_util can be used when od-database is a submodule part 2
This commit is contained in:
parent
88166054ad
commit
f729b462f0
1
app.py
1
app.py
@ -5,7 +5,6 @@ from urllib.parse import urlparse
|
||||
import os
|
||||
import time
|
||||
import datetime
|
||||
import itertools
|
||||
from database import Database, Website, InvalidQueryException
|
||||
from flask_recaptcha import ReCaptcha
|
||||
import od_util
|
||||
|
@ -2,6 +2,7 @@ from tasks import Task, TaskResult
|
||||
from reddit_bot import RedditBot
|
||||
import praw
|
||||
from search.search import SearchEngine
|
||||
import json
|
||||
|
||||
|
||||
class PostCrawlCallback:
|
||||
@ -9,6 +10,9 @@ class PostCrawlCallback:
|
||||
def __init__(self, task: Task):
|
||||
self.task = task
|
||||
|
||||
if self.task.callback_args:
|
||||
self.task.callback_args = json.loads(self.task.callback_args)
|
||||
|
||||
def run(self, task_result: TaskResult, search: SearchEngine):
|
||||
raise NotImplementedError
|
||||
|
||||
|
@ -5,7 +5,12 @@ import os
|
||||
import validators
|
||||
import re
|
||||
from ftplib import FTP
|
||||
from . import config
|
||||
|
||||
# TODO: find a better way to do this
|
||||
try:
|
||||
from . import config
|
||||
except ImportError:
|
||||
import config
|
||||
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
@ -58,6 +58,7 @@ class RedditBot:
|
||||
try:
|
||||
reddit_comment.edit(new_message)
|
||||
print("Edit comment " + reddit_comment.id)
|
||||
break
|
||||
except Exception as e:
|
||||
print("Waiting 5 minutes: " + str(e))
|
||||
time.sleep(300)
|
||||
|
Loading…
x
Reference in New Issue
Block a user