def __init__(self): CONST = _Const() self.HOST = CONST.MYSQL_HOST_IP self.ITEMDB = 'itemdb' self.PORT = 3306 self.USER = CONST.MYSQL_USER self.PASSWORD = CONST.MYSQL_PASS
def __init__(self): self._screenSerialPort = 0 self._screenReplyBuffer = [] self._screenDetected = False self._replyFromScreen = False self._touchCount = 0 self._screenIsAsleep = False # Get some common constants from the imported file self.CONST = const._Const()
def __init__(self): _DBUtil.__init__(self) CONST = _Const() self.HOST = CONST.MYSQL_HOST_IP self.ITEMDB = 'itemdb' self.PORT = 3306 self.USER = CONST.MYSQL_USER self.PASSWORD = CONST.MYSQL_PASS self.typeToTableMap = {} self.nameToTypeMap = {} self.getAllTypes()
def LoadTeamData(stop_date, input_team): CONST = _Const() data = Teams.csvopen(CONST.INPUT_FILE) next(data) fixtures = {} for row in data: date = dt.datetime.strptime(row[1], '%d/%m/%y') if date > stop_date: break fixture_date = dt.datetime.strptime(row[1], '%d/%m/%y').date() home_team = row[2] away_team = row[3] home_goals = int(row[4]) away_goals = int(row[5]) home_shots = int(row[11]) away_shots = int(row[12]) home_sht = int(row[13]) away_sht = int(row[14]) home_corners = int(row[17]) away_corners = int(row[18]) if row[6] == 'H': winner = 2 elif row[6] == 'A': winner = -1 elif row[6] == 'D': winner = 1 if (home_team == input_team or away_team == input_team): id_value = home_team + '_' + away_team if id_value not in fixtures: fixtures[id_value] = Teams.Fixture(name=id_value, fixture_date=fixture_date, winner=winner) fixtures[id_value].hometeam = Teams.Team(name=home_team) fixtures[id_value].awayteam = Teams.Team(name=away_team) fixtures[id_value].hometeam.update(home_goals, away_goals, home_shots, home_sht, home_corners) fixtures[id_value].awayteam.update(away_goals, home_goals, away_shots, away_sht, away_corners) return fixtures
''' Created on 26/09/2011 @author: Jairo ''' print "Loading Analyze..." from xml.dom.minidom import Document, parse import rules import static import xml, sys, os, errno import constants, utils CONST=constants._Const() cweAtts = CONST.cweAtts listOS = CONST.listOS listWEB = CONST.listWeb #function analyze attack vector def analyzeAV(arch,av,os,web,dir): # rav[] store CWSS values from rules rav=[] for comp in av: #attributesbyrules rav.append(rules.rules(comp)) #loadAttCWE has new features CWE=static.loadAttCWE()
import Teams import collections import datetime as dt import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit from constants import _Const import dataLoader CONST = _Const() # Inputs input_team = input("Team: ") input_date = input("Date (dd/mm/yy format): ") stop_date = dt.datetime.strptime(input_date, '%d/%m/%y') # Load the data fixtures = dataLoader.LoadTeamData(dt.datetime.now(), input_team) # Sort it sorted_teams = sorted(fixtures.values(), reverse=False, key=lambda t: t.fixture_date) last_10_items = sorted_teams[-10:] goalsfor = 0 goalsagainst = 0 cornersfor = 0 cornersagainst = 0 btts = 0 oOF = 0
''' Created on 26/09/2011 @author: Jairo ''' print "Loading Analyze..." from xml.dom.minidom import Document, parse import rules import static import xml, sys, os, errno import constants, utils CONST = constants._Const() cweAtts = CONST.cweAtts listOS = CONST.listOS listWEB = CONST.listWeb #function analyze attack vector def analyzeAV(arch, av, os, web, dir): # rav[] store CWSS values from rules rav = [] for comp in av: #attributesbyrules rav.append(rules.rules(comp)) #loadAttCWE has new features
from random import randint from flask import Flask, session, render_template, json, request import sys import re from offer import Offer from util import Util from constants import _Const from dbutil import DBUtil const = _Const() _DBUtil = DBUtil() app = Flask(__name__) app.config['UPLOAD_FOLDER'] = const.UPLOAD_FOLDER @app.route('/') def homepage(): return render_template("index.html") @app.route('/submitoffer') def submitoffer(): return render_template("submitoffer.html") @app.route('/login', methods=['GET', 'POST']) def login(): if request.method == 'POST': session['username'] = request.form['username'] return redirect(url_for('index')) return ''' <form action="" method="post"> <p><input type=text name=username>