from database_access import * from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.Utils import COMMASPACE, formatdate from jinja2 import Template from sqlalchemy import create_engine import urllib import logging import service #-mo FIXME: The old code used the production DB in -int and -pro. However, # as at the moment -int is the new -dev, for the moment always use # the development DB. connectionDictionary = service.secrets['connections']['dev']["writer"] engine = create_engine(service.getSqlAlchemyConnectionString(connectionDictionary), echo=False) Session = sessionmaker(bind=engine) class API(object): def __init__(self, param): self.parent_obj = param ##inherit parent object -> to be albe use all methods of DB access @cherrypy.expose def index(self): ##take info from defined methods docstrings return self.parent_obj.loadPage('API') def get_CatSubCat_details(self, catSubCat, release_name): data = self.parent_obj.mainInformation(catSubCat, release_name) tmp = json.loads(data) detailedinfo = {} tmp_arr = [] #an array to save all the status
from suds.client import Client from suds.transport.http import HttpAuthenticated from suds import WebFault import netrc import subprocess import copy import time import service from database_access import * from sqlalchemy import create_engine connectionDictionary = service.secrets['connections']['dev']["writer"] engine = create_engine(service.getSqlAlchemyConnectionString(connectionDictionary), echo=False) Session = sessionmaker(bind=engine) possible_status_list = ["CSC", "TAU", "TRACKING", "BTAG", "JET", "ECAL", "RPC", "PHOTON", "MUON", "MET", "ELECTRON", "TK", "HCAL", "DT", "SUMMARY", "TAU", "JET", "HIGGS", "TOP", "MUON", "PHOTON", "MET", "ELECTRON", "EXOTICA", "SUSY", "HEAVYFLAVOR", "SUMMARY", "B", "HIGGS", "FWD", "TOP", "SMP", "EXOTICA", "SUSY", "B2G", "HIN", "CASTOR", "L1", "GEN", "MTD", "PPS", "PF", "SUMMARY"] # create a subclass and override the handler methods class MyHTMLParser(HTMLParser): email = "" get_name = False
from email.MIMEText import MIMEText from email.Utils import COMMASPACE, formatdate from jinja2 import Template from sqlalchemy import create_engine import urllib import logging import service import traceback import time #-mo FIXME: The old code used the production DB in -int and -pro. However, # as at the moment -int is the new -dev, for the moment always use # the development DB. connectionDictionary = service.secrets['connections']['dev']["writer"] engine = create_engine( service.getSqlAlchemyConnectionString(connectionDictionary), echo=False) Session = sessionmaker(bind=engine) class API(object): def __init__(self, param): self.parent_obj = param ##inherit parent object -> to be albe use all methods of DB access @cherrypy.expose def index(self): ##take info from defined methods docstrings return self.parent_obj.loadPage('API') def get_CatSubCat_details(self, catSubCat, release_name): data = self.parent_obj.mainInformation(catSubCat, release_name) tmp = simplejson.loads(data)