##// END OF EJS Templates
Minor import cleanup. Added forgotten fetch command file to mercurial
neko259 -
r1979:b71d904c default
parent child Browse files
Show More
@@ -0,0 +1,16 b''
1 from django.core.management import BaseCommand
2 from django.db import transaction
3
4 from boards.models.source import ThreadSource
5
6 __author__ = 'neko259'
7
8
9 class Command(BaseCommand):
10 help = 'Fetches data from sources and posts into appropriate threads'
11
12 @transaction.atomic
13 def handle(self, *args, **options):
14 for source in ThreadSource.objects.all():
15 source.fetch_latest_posts()
16
@@ -1,36 +1,32 b''
1 import hashlib
2 import logging
1 import logging
3 import re
4 import time
2 import time
5
3
4 import hashlib
6 import pytz
5 import pytz
7
6 import re
8 from PIL import Image
7 from PIL import Image
9
10 from django import forms
8 from django import forms
9 from django.core.cache import cache
10 from django.core.files.images import get_image_dimensions
11 from django.core.files.uploadedfile import SimpleUploadedFile, UploadedFile
11 from django.core.files.uploadedfile import SimpleUploadedFile, UploadedFile
12 from django.forms.utils import ErrorList
12 from django.forms.utils import ErrorList
13 from django.utils.translation import ugettext_lazy as _, ungettext_lazy
13 from django.utils.translation import ugettext_lazy as _, ungettext_lazy
14 from django.core.files.images import get_image_dimensions
15 from django.core.cache import cache
16
14
17 import boards.settings as board_settings
15 import boards.settings as board_settings
18 import neboard
19 from boards import utils
16 from boards import utils
20 from boards.abstracts.constants import REGEX_TAGS
17 from boards.abstracts.constants import REGEX_TAGS
18 from boards.abstracts.settingsmanager import get_settings_manager
21 from boards.abstracts.sticker_factory import get_attachment_by_alias
19 from boards.abstracts.sticker_factory import get_attachment_by_alias
22 from boards.abstracts.settingsmanager import get_settings_manager
23 from boards.forms.fields import UrlFileField
20 from boards.forms.fields import UrlFileField
24 from boards.mdx_neboard import formatters
21 from boards.mdx_neboard import formatters
25 from boards.models import Attachment
22 from boards.models import Attachment
26 from boards.models import Tag
23 from boards.models import Tag
27 from boards.models.attachment import StickerPack
24 from boards.models.attachment import StickerPack
28 from boards.models.attachment.downloaders import download, REGEX_MAGNET
25 from boards.models.attachment.downloaders import download, REGEX_MAGNET
26 from boards.models.attachment.viewers import FILE_TYPES_IMAGE
29 from boards.models.post import TITLE_MAX_LENGTH
27 from boards.models.post import TITLE_MAX_LENGTH
30 from boards.utils import validate_file_size, get_file_mimetype, \
28 from boards.utils import validate_file_size, get_file_mimetype, \
31 FILE_EXTENSION_DELIMITER, get_tripcode_from_text
29 FILE_EXTENSION_DELIMITER, get_tripcode_from_text
32 from boards.models.attachment.viewers import FILE_TYPES_IMAGE
33 from neboard import settings
34
30
35 SECTION_FORMS = 'Forms'
31 SECTION_FORMS = 'Forms'
36
32
General Comments 0
You need to be logged in to leave comments. Login now