コード例 #1
0
    def __init__(self, LIVE=False):

        dbGlobals.connect()

        RestartingGreenlet.__init__(self, LIVE=LIVE)
        self.SLEEP = 40 # Run every 10 seconds
        self.LIVE = LIVE
コード例 #2
0
ファイル: hotCarApp.py プロジェクト: wsheffel/DCMetroMetrics
    def __init__(self, LIVE=False):

        dbGlobals.connect()

        RestartingGreenlet.__init__(self, LIVE=LIVE)
        self.SLEEP = 40  # Run every 10 seconds
        self.LIVE = LIVE
コード例 #3
0
"""
Script to compute the daily service reports for escalators and elevators.
This script will update the database and write json files for each updated day.
"""

# Connect to the database
from dcmetrometrics.common import dbGlobals
dbGlobals.connect()

import sys, os
from datetime import datetime, date, timedelta
import gc
from operator import attrgetter
# gc.set_debug(gc.DEBUG_STATS)

from dcmetrometrics.common.dbGlobals import G
from dcmetrometrics.eles import dbUtils
from dcmetrometrics.common.metroTimes import getLastOpenTime
from dcmetrometrics.eles.models import Unit, SymptomCode, UnitStatus, SystemServiceReport
from dcmetrometrics.common.globals import WWW_DIR
from dcmetrometrics.common.utils import gen_days
from dcmetrometrics.common.JSONifier import JSONWriter

import argparse
parser = argparse.ArgumentParser(description='Run daily service reports.')
parser.add_argument('--all', action = 'store_true',
                   help='Compute all, instead of a one day update.')


##########################################
# Set up logging
コード例 #4
0
def connect():
    dbGlobals.connect()
コード例 #5
0
def connect():
    dbGlobals.connect()