Ejemplo n.º 1
0
    def __init__(self):
        #list of cbsd objects
        self.cbsdList = []

        self.alarm = Alarm()

        self.license = License()

        self.logger = logger()
Ejemplo n.º 2
0
    def __init__(self, sqlCbsd: dict):
        self.cbsdState = consts.DEREG
        self.bandwidth = 20
        self.userID = sqlCbsd['userID']
        self.fccID = sqlCbsd['fccID']
        self.SN = sqlCbsd['SN']
        # self.cbsdID =             sqlCbsd['cbsdID']
        self.cbsdCat = sqlCbsd['cbsdCategory']
        # self.sasStage =           sqlCbsd['sasStage']
        # self.txPower =            sqlCbsd['TxPower']
        # self.earfcn =             sqlCbsd['EARFCN']
        # self.antennaGain =        sqlCbsd['antennaGain']
        # self.adminState =         sqlCbsd['AdminState']
        # self.grantID =            sqlCbsd['grantID']
        # self.operationalState =   sqlCbsd['operationalState']
        # self.transmitExpireTime = sqlCbsd['transmitExpireTime']
        # self.grantExpireTime =    sqlCbsd['grantExpireTime']
        # self.cellIdenity =        sqlCbsd['CellIdentity']
        # self.ipAddress =          sqlCbsd['IPAddress']
        # self.connreqUname =       sqlCbsd['connreqUname']
        # self.connreqPass =        sqlCbsd['connreqPass']
        # self.connreqURL =         sqlCbsd['connreqURL']
        self.hclass = sqlCbsd['hclass']
        self.reponseObj = Resposne()

        #is cbsd in the initial or subsequent heartbeat
        # self.subHeart =          sqlCbsd['subHeart']

        #in the case where sas suggests new operational parameters
        # self.sasOperationalParams={}

        # self.maxEirp = 0
        # #set sasStage
        # self.setSasStage(consts.REG)
        # #set maxEirp
        # self.calcMaxEirp()
        # #set Low and high Frequcy
        # self.set_low_and_high_frequncy(self.earfcn)
        # #populate earfcnList
        # self.getEarfcnList()

        self.logger = logger()
from app import app
from flask import render_template, jsonify, request, session, Markup
from lib.log import logger
import lib.oformat as of
import lib.ctgov as ctgov
import lib.question_info_entropy as qst

import time
import random
from app import general_pool_criteria
from collections import Counter

log = logger('dquest-view')


# home page
@app.route('/')
def index():
    # get trial number
    # nnct = ctgov.get_nct_number ('http://clinicaltrials.gov/search?term=&displayxml=True&count=0')
    nnct = ctgov.get_nct_number(
        'http://clinicaltrials.gov/search?term=covid-19&displayxml=True&count=0'
    )
    nnct_us = ctgov.get_nct_number(
        'http://clinicaltrials.gov/search?term=covid-19&cntry=US&displayxml=True&count=0'
    )
    # active_roster = qst.find_active_nct_id_list()
    # nnct_local_kb = len(active_roster)

    # testing without length of active trials
    active_roster = []
Ejemplo n.º 4
0
import os 
import ldap
import time
import bcrypt
import urlparse
import itertools
import traceback

from datetime import datetime
from flask.ext.login import AnonymousUserMixin

from app import app, db
from lib import utils
from lib.log import logger
logging = logger('MODEL', app.config['LOG_LEVEL'], app.config['LOG_FILE']).config()

LDAP_URI = app.config['LDAP_URI']
LDAP_USERNAME = app.config['LDAP_USERNAME']
LDAP_PASSWORD = app.config['LDAP_PASSWORD']
LDAP_SEARCH_BASE = app.config['LDAP_SEARCH_BASE']

PDNS_STATS_URL = app.config['PDNS_STATS_URL']
PDNS_API_KEY = app.config['PDNS_API_KEY']


class Anonymous(AnonymousUserMixin):
  def __init__(self):
    self.username = '******'


class User(db.Model):
Ejemplo n.º 5
0
 def __init__(self):
     self.logger = logger()
     self.funcDict = {"registartionResposne":self.registration}
Ejemplo n.º 6
0
from app import app
from flask import render_template, jsonify, request, session
from lib.extensions import cache
from lib.log import logger
from lib.forms import SearchForm
import lib.oformat as of
import lib.tagcloud as tcloud
import lib.ctgov as ctgov

log = logger ('etacts-view')


# home page
@app.route('/etacts')
def index ():
    # get trial number
    nnct = ctgov.get_nct_number ('http://clinicaltrials.gov/search?term=&displayxml=True&count=0')
    # search form    
    form = SearchForm()
    return render_template('index.html', form = form, nnct = of.format_nct_number(nnct))


# about page
@app.route ('/etacts/about')
def about ():
    print 'ciao'
    return render_template('about.html')


# help page
@app.route('/etacts/help')
Ejemplo n.º 7
0
import time
import base64
import bcrypt
import urlparse
import itertools
import traceback
import onetimepass

from datetime import datetime
from distutils.version import StrictVersion
from flask_login import AnonymousUserMixin

from app import app, db
from lib import utils
from lib.log import logger
logging = logger('MODEL', app.config['LOG_LEVEL'], app.config['LOG_FILE']).config()

if 'LDAP_TYPE' in app.config.keys():
    LDAP_URI = app.config['LDAP_URI']
    LDAP_USERNAME = app.config['LDAP_USERNAME']
    LDAP_PASSWORD = app.config['LDAP_PASSWORD']
    LDAP_SEARCH_BASE = app.config['LDAP_SEARCH_BASE']
    LDAP_TYPE = app.config['LDAP_TYPE']
    LDAP_FILTER = app.config['LDAP_FILTER']
    LDAP_USERNAMEFIELD = app.config['LDAP_USERNAMEFIELD']
else:
    LDAP_TYPE = False

PDNS_STATS_URL = app.config['PDNS_STATS_URL']
PDNS_API_KEY = app.config['PDNS_API_KEY']
PDNS_VERSION = app.config['PDNS_VERSION']
Ejemplo n.º 8
0
 def __init__(self):
     self.logger = logger()
                    help="The date to start on, in the "
                    "example format 31122019 for dec "
                    "31st, 2019. If not specified, it "
                    "will be tomorrow.")
args = parser.parse_args()
flagNoop = args.noop
flagVerbose = args.verbose

uc.flagVerbose = flagVerbose
mb.flagVerbose = flagVerbose
mb.flagNoop = flagNoop

######################################
# CONFIGURE LOGGING
# ####################################
logger = log.logger(flagVerbose)

######################################
# CHECK REQUIREMENTS
# ####################################

if sys.version_info <= (3, 6, 0):
    logger.critical(
        "You are running Python version {0}, but ony >= 3.6 is tested".format(
            sys.version_info))
    exit(1)

######################################
# GET THE PARAMETERS FROM THE CONFIG FILE
# ####################################
config = configparser.ConfigParser()
Ejemplo n.º 10
0
 def __init__(self):
     self.json = Json()
     self.logger = logger()
     self.session = dbSession()
     self.updateNode = False
Ejemplo n.º 11
0
import os
import ldap
import time
import bcrypt
import urlparse
import traceback

from datetime import datetime
from flask.ext.login import AnonymousUserMixin

from app import app, db
from lib import utils
from lib.log import logger

logging = logger("MODEL", app.config["LOG_LEVEL"], app.config["LOG_FILE"]).config()

LDAP_URI = app.config["LDAP_URI"]
LDAP_USERNAME = app.config["LDAP_USERNAME"]
LDAP_PASSWORD = app.config["LDAP_PASSWORD"]
LDAP_SEARCH_BASE = app.config["LDAP_SEARCH_BASE"]

PDNS_STATS_URL = app.config["PDNS_STATS_URL"]
PDNS_API_KEY = app.config["PDNS_API_KEY"]


class Anonymous(AnonymousUserMixin):
    def __init__(self):
        self.username = "******"


class User(db.Model):
Ejemplo n.º 12
0
 def __init__(self):
     self.json = Json()
     self.logger = logger()
Ejemplo n.º 13
0
import lib.data
"""
어제 일자까지의 모든 주가를 업데이트 한다.
"""
stmt1 = "insert IGNORE into stocks (scode, name) VALUES (%s,%s);"
stmt2 = "select max(date) from history_days where scode=%s;"
stmt3 = "insert into history_days (scode, date, open, high, low, close, volume) VALUES (%s,%s, %s, %s,%s,%s,%s) \
            ON DUPLICATE KEY UPDATE \
            open=%s, high=%s, low=%s, close=%s, volume=%s;"

stmt4 = "insert IGNORE into predicts (scode, date, predict_days, expect1, expect2, expect3, expect4, expect5) \
            VALUES (%s,%s,%s,%s,%s,%s,%s,%s);"

date_format = '%Y-%m-%d'

logger = log.logger(os.path.basename(__file__))


def update_stocks(db, df, ext):
    for index, row in df.iterrows():
        code = row['종목코드']
        scode = ext + code
        name = row['회사명']

        done = False
        count = 0
        while not done:
            try:
                with closing(db.cursor()) as cur:
                    cur.execute(stmt1, (scode, name))
                    db.commit()
Ejemplo n.º 14
0
 def __init__(self):
     self.json = Json()
     self.logger = logger()
     # self.cbsds = []
     self.gm = GrantManger()
     self.session = dbSession()
Ejemplo n.º 15
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'orleven'

from lib.log import logger

logger = logger()
conf = {}
debug = False
looptimer = None