-
Notifications
You must be signed in to change notification settings - Fork 0
/
microtest.py
executable file
·38 lines (28 loc) · 934 Bytes
/
microtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
import os
import sys
import datetime
import logging
import logging.handlers
import argparse
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "okerr.settings")
import django
from django.conf import settings
from okerrui.impex import Impex
from okerrui.exceptions import OkerrError
django.setup()
from okerrui.models import Profile
parser = argparse.ArgumentParser(description='okerr indicator MQ processor')
parser.add_argument('-v', '--verbose', action='store_true', default=False, help='verbose mode')
parser.add_argument('--fix', action='store_true', default=False, help='verbose mode')
args = parser.parse_args()
if args.fix:
# any your debug/test code
pass
if args.verbose:
log = logging.getLogger('okerr')
log.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stderr)
handler.setLevel(logging.DEBUG)
log.addHandler(handler)
print("minimal Django setup ready")