srg/monthplan/management/commands/00_load_surveypath.py
2024-04-26 12:43:00 +03:00

30 lines
799 B
Python

from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.core import mail
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.core.mail import send_mail
import time
import re
import glob
import logging
from monthplan.utils import load_surveypath_data
class Command(BaseCommand):
help = 'Initiates data base'
def handle(self, *args, **options):
logging.getLogger().setLevel(logging.INFO)
path = "/export/django/srg/data/npol/DMV/ARJ-SCAN/20??????_??????_???????????.iki"
ikifiles = []
for file in glob.glob(path):
ikifiles.append(file)
for file in ikifiles:
load_surveypath_data(file,100,notify=True)