major rewrite
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,3 +14,4 @@ __pycache__/
|
||||
.temp/
|
||||
|
||||
conf.json
|
||||
config.json
|
||||
@@ -27,7 +27,7 @@
|
||||
3) Use command prompt to enter the directory of the scripts, then install package requirements:<br/>
|
||||
```pip install -r requirements.txt``` <br/>
|
||||
4) Copy **config.example.json** to **config.json** and edit to your specific config.
|
||||
4) Drop your unit's **MachineProductConfiguration.xml** file into the root of the script
|
||||
4) Drop your unit's **MachineProductCfg.xml** file into the root of the script
|
||||
5) Run ``py main.py``
|
||||
|
||||
### Attributions & Disclaimers
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import asyncio
|
||||
from recordGenerators import Alerts,CurrentObservations,HourlyForecast,DailyForecast, AirQuality, AirportDelays, AchesAndPains, Breathing, HeatingAndCooling, MosquitoActivity, PollenForecast, TideForecast, WateringNeeds
|
||||
from recordGenerators import alerts,currentObservations,hourlyForecast,dailyForecast, airQuality, airportDelays, achesAndPains, breathing, heatingAndCooling, mosquitoActivity, pollenForecast, tideForecast, wateringNeeds
|
||||
from radar import TWCRadarCollector
|
||||
from datetime import datetime
|
||||
|
||||
@@ -25,67 +25,67 @@ async def updateSatradTask():
|
||||
|
||||
async def alertsTask():
|
||||
while True:
|
||||
await Alerts.makeRecord()
|
||||
await alerts.makeRecord()
|
||||
await asyncio.sleep(60)
|
||||
|
||||
async def coTask():
|
||||
while True:
|
||||
await CurrentObservations.makeDataFile()
|
||||
await currentObservations.makeDataFile()
|
||||
await asyncio.sleep(5 * 60)
|
||||
|
||||
# These tasks should be updated every hour
|
||||
|
||||
async def hfTask():
|
||||
while True:
|
||||
await HourlyForecast.makeDataFile()
|
||||
await hourlyForecast.makeDataFile()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def dfTask():
|
||||
while True:
|
||||
await DailyForecast.makeDataFile()
|
||||
await dailyForecast.makeDataFile()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def aqTask():
|
||||
while True:
|
||||
await AirQuality.writeData()
|
||||
await airQuality.writeData()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def aptTask():
|
||||
while True:
|
||||
await AirportDelays.writeData()
|
||||
await airportDelays.writeData()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def apTask():
|
||||
while True:
|
||||
await AchesAndPains.makeRecord()
|
||||
await achesAndPains.makeRecord()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def brTask():
|
||||
while True:
|
||||
await Breathing.makeDataFile()
|
||||
await breathing.makeDataFile()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def hcTask():
|
||||
while True:
|
||||
await HeatingAndCooling.makeRecord()
|
||||
await heatingAndCooling.makeRecord()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def maTask():
|
||||
while True:
|
||||
await MosquitoActivity.makeRecord()
|
||||
await mosquitoActivity.makeRecord()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def pTask():
|
||||
while True:
|
||||
await PollenForecast.makeDataFile()
|
||||
await pollenForecast.makeDataFile()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def tTask():
|
||||
while True:
|
||||
await TideForecast.makeRecord()
|
||||
await tideForecast.makeRecord()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
async def wnTask():
|
||||
while True:
|
||||
await WateringNeeds.makeRecord()
|
||||
await wateringNeeds.makeRecord()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
42
main.py
42
main.py
@@ -5,11 +5,11 @@ import logging,coloredlogs
|
||||
from radar import TWCRadarCollector
|
||||
import os
|
||||
from datetime import datetime
|
||||
import RecordTasks
|
||||
import recordTasks
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
@@ -19,7 +19,7 @@ useRadarServer = cfg["useRadarServer"]
|
||||
|
||||
async def createTemp():
|
||||
""" Used on a first time run, creates necessary files & directories for the message encoder to work properly. """
|
||||
if not (os.path.exists('./.temp/')):
|
||||
if not (os.path.exists('./.temp')):
|
||||
l.info("Creating necessary directories & files..")
|
||||
os.mkdir('./.temp')
|
||||
|
||||
@@ -33,9 +33,9 @@ async def createTemp():
|
||||
os.mkdir('./.temp/output/satrad')
|
||||
|
||||
# Create msgId file for bit.py
|
||||
async with aiofiles.open('./.temp/msgId.txt', 'w') as msgId:
|
||||
await msgId.write('410080515')
|
||||
await msgId.close()
|
||||
#async with aiofiles.open('./.temp/msgId.txt', 'w') as msgId:
|
||||
#await msgId.write('694203')
|
||||
#await msgId.close()
|
||||
else:
|
||||
l.debug(".temp file exists")
|
||||
return
|
||||
@@ -44,21 +44,21 @@ async def createTemp():
|
||||
async def main():
|
||||
await createTemp()
|
||||
|
||||
mosaicTask = asyncio.create_task(RecordTasks.updateMosaicTask())
|
||||
satradTask = asyncio.create_task(RecordTasks.updateSatradTask())
|
||||
alertsTask = asyncio.create_task(RecordTasks.alertsTask())
|
||||
coTask = asyncio.create_task(RecordTasks.coTask())
|
||||
hfTask = asyncio.create_task(RecordTasks.hfTask())
|
||||
dfTask = asyncio.create_task(RecordTasks.dfTask())
|
||||
aqTask = asyncio.create_task(RecordTasks.aqTask())
|
||||
aptTask = asyncio.create_task(RecordTasks.aptTask())
|
||||
apTask = asyncio.create_task(RecordTasks.apTask())
|
||||
brTask = asyncio.create_task(RecordTasks.brTask())
|
||||
hcTask = asyncio.create_task(RecordTasks.hcTask())
|
||||
maTask = asyncio.create_task(RecordTasks.maTask())
|
||||
pTask = asyncio.create_task(RecordTasks.pTask())
|
||||
tTask = asyncio.create_task(RecordTasks.tTask())
|
||||
wnTask = asyncio.create_task(RecordTasks.wnTask())
|
||||
mosaicTask = asyncio.create_task(recordTasks.updateMosaicTask())
|
||||
satradTask = asyncio.create_task(recordTasks.updateSatradTask())
|
||||
alertsTask = asyncio.create_task(recordTasks.alertsTask())
|
||||
coTask = asyncio.create_task(recordTasks.coTask())
|
||||
hfTask = asyncio.create_task(recordTasks.hfTask())
|
||||
dfTask = asyncio.create_task(recordTasks.dfTask())
|
||||
aqTask = asyncio.create_task(recordTasks.aqTask())
|
||||
aptTask = asyncio.create_task(recordTasks.aptTask())
|
||||
apTask = asyncio.create_task(recordTasks.apTask())
|
||||
brTask = asyncio.create_task(recordTasks.brTask())
|
||||
hcTask = asyncio.create_task(recordTasks.hcTask())
|
||||
maTask = asyncio.create_task(recordTasks.maTask())
|
||||
pTask = asyncio.create_task(recordTasks.pTask())
|
||||
tTask = asyncio.create_task(recordTasks.tTask())
|
||||
wnTask = asyncio.create_task(recordTasks.wnTask())
|
||||
|
||||
# In theory, these should all run concurrently without problems
|
||||
await alertsTask
|
||||
|
||||
216
py2Lib/bit.old
Normal file
216
py2Lib/bit.old
Normal file
@@ -0,0 +1,216 @@
|
||||
import socket
|
||||
import sys
|
||||
import os
|
||||
import struct
|
||||
import binascii
|
||||
import math
|
||||
import time
|
||||
import logging,coloredlogs
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
|
||||
MCAST_GRP = cfg["multicastGroup"]
|
||||
MCAST_IF = cfg["multicastIf"]
|
||||
BUF_SIZE = 1396
|
||||
|
||||
MULTICAST_TTL = 2
|
||||
|
||||
conn = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
||||
conn.setsockopt(socket.IPPROTO_IP,socket.IP_ADD_MEMBERSHIP,socket.inet_aton(MCAST_GRP)+socket.inet_aton(MCAST_IF))
|
||||
|
||||
test = b"This is a test"
|
||||
|
||||
def sendFile(files, commands, numSgmts, Pri):
|
||||
if Pri == 0:
|
||||
MCAST_PORT = 7787
|
||||
elif Pri == 1:
|
||||
MCAST_PORT = 7788
|
||||
else:
|
||||
l.critical("Invalid Priority Flag. 0 = Routine Message 1 = High Priority Message\n\nScript will now terminate...")
|
||||
exit()
|
||||
#Get the next message ID
|
||||
with open('./.temp/msgId.txt', "r") as f:
|
||||
oMsgId = f.read()
|
||||
msgNum = int(oMsgId)
|
||||
f.close()
|
||||
|
||||
nMsgNum = msgNum + 1
|
||||
h = open('./.temp/msgId.txt', "w")
|
||||
h.write(str(nMsgNum))
|
||||
h.close()
|
||||
segnmNum = 0
|
||||
if Pri == 0:
|
||||
l.info("Sending Routine Msg-" + str(msgNum) + " on UDP " + MCAST_GRP + " " + str(MCAST_PORT) + "....")
|
||||
elif Pri == 1:
|
||||
l.info("Sending High Priority Msg-" + str(msgNum) + " on UDP " + MCAST_GRP + " " + str(MCAST_PORT) + "....")
|
||||
startFlag = False
|
||||
|
||||
for x, y in zip(files, commands):
|
||||
size = os.path.getsize(x)
|
||||
check = size - BUF_SIZE
|
||||
pToBeSent = size / 1405
|
||||
packRounded = math.ceil(pToBeSent) + 1
|
||||
numSegments = numSgmts + 3
|
||||
total_sent = 0
|
||||
payloadLength = 0
|
||||
packet_count = 1
|
||||
j = 0
|
||||
pc = packet_count.to_bytes(1, byteorder='big')
|
||||
i = 0
|
||||
encode1 = bytes(y + 'I2MSG', 'UTF-8')
|
||||
commandLength = len(y)
|
||||
encode2 = commandLength.to_bytes(4, byteorder='little')
|
||||
theCommand = b"".join([encode1, encode2])
|
||||
char = ''
|
||||
new_file = open(x, "ab")
|
||||
new_file.write(theCommand) # Append command to end of the file
|
||||
new_file.close()
|
||||
new_size = os.path.getsize(x)
|
||||
|
||||
if startFlag == False:
|
||||
#Our 34 byte beginning packet
|
||||
p1 = struct.pack(">BHHHIIBBBBBBBIBIBBB", 18, 1, 0 , 16, msgNum, 0, segnmNum, 0, 0, 8, numSegments, 3, 0, 0, 8, packRounded, 0, 0, 0)
|
||||
conn.sendto(p1, (MCAST_GRP, MCAST_PORT))
|
||||
startFlag = True
|
||||
with open(x,"rb") as message:
|
||||
message.seek(0)
|
||||
data = message.read(BUF_SIZE)
|
||||
while data:
|
||||
packetHeader = struct.pack(">BHHHIIBBB", 18, 1, 0, 1405, msgNum, packet_count, 0, 0, 0)
|
||||
fec = struct.pack("<IBI", packet_count, 0, new_size)
|
||||
if len(data) < BUF_SIZE:
|
||||
nullCharacterLen = BUF_SIZE - len(data)
|
||||
char = ''
|
||||
while(i < nullCharacterLen):
|
||||
char += '00'
|
||||
i = i+1
|
||||
theNull = bytes.fromhex(char)
|
||||
conn.sendto(packetHeader + fec + data + theNull, (MCAST_GRP, MCAST_PORT))
|
||||
else:
|
||||
conn.sendto(packetHeader + fec + data, (MCAST_GRP, MCAST_PORT))
|
||||
l.debug(packet_count)
|
||||
packet_count += 1
|
||||
j += 1
|
||||
|
||||
#Rate Limit UDP Packets To Prevent Packet Overflow On Transport Stream.
|
||||
if j == 1000: #Number of packets to be sent before pausing
|
||||
time.sleep(2) #Pause for this number of seconds
|
||||
j = 0
|
||||
data = message.read(BUF_SIZE)
|
||||
else:
|
||||
data = message.read(BUF_SIZE)
|
||||
segnmNum += 1
|
||||
|
||||
# OUR TEST MESSAGE BLOCK
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
w = 3
|
||||
while w <= 3 and w != 0:
|
||||
p3 = struct.pack(">BHHHIIBBBBBBBI", 18, 1, 1, 8, msgNum, 0, segnmNum, 0, 0, 8, 0, 0, 0, 67108864)
|
||||
p4 = struct.pack(">BHHHIIBBB", 18, 1, 1, 14, msgNum, 1, segnmNum, 0, 0) + test
|
||||
conn.sendto(p3, (MCAST_GRP, MCAST_PORT))
|
||||
conn.sendto(p4, (MCAST_GRP, MCAST_PORT))
|
||||
segnmNum += 1
|
||||
w -= 1
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
def sendCommand(command, Pri, msgNum = None):
|
||||
if Pri == 0:
|
||||
MCAST_PORT = 7787
|
||||
elif Pri == 1:
|
||||
MCAST_PORT = 7788
|
||||
else:
|
||||
l.critical("Invalid Priority Flag. 0 = Routine Message 1 = High Priority Message\n\nScript will now terminate...")
|
||||
exit()
|
||||
#Get the next message ID
|
||||
with open('./.temp/msgId.txt', "r") as f:
|
||||
oMsgId = f.read()
|
||||
msgNum = int(oMsgId)
|
||||
f.close()
|
||||
|
||||
nMsgNum = msgNum + 1
|
||||
h = open('./.temp/msgId.txt', "w")
|
||||
h.write(str(nMsgNum))
|
||||
h.close()
|
||||
segnmNum = 0
|
||||
if Pri == 0:
|
||||
l.info("Sending Routine Msg-" + str(msgNum) + " on UDP " + MCAST_GRP + " " + str(MCAST_PORT) + "....")
|
||||
elif Pri == 1:
|
||||
l.info("Sending High Priority Msg-" + str(msgNum) + " on UDP " + MCAST_GRP + " " + str(MCAST_PORT) + "....")
|
||||
startFlag = False
|
||||
|
||||
for x in command:
|
||||
bx = bytes(x, 'utf-8')
|
||||
with open('./.temp/command', 'wb') as c:
|
||||
c.write(bx)
|
||||
c.close()
|
||||
size = os.path.getsize('./.temp/command')
|
||||
encode1 = bytes('I2MSG', 'UTF-8')
|
||||
commandLength = size
|
||||
encode2 = commandLength.to_bytes(4, byteorder='little')
|
||||
theCommand = b"".join([encode1, encode2])
|
||||
with open('./.temp/command', 'ab') as d:
|
||||
d.write(theCommand)
|
||||
d.close()
|
||||
check = size - BUF_SIZE
|
||||
pToBeSent = size / 1405
|
||||
packRounded = math.ceil(pToBeSent) + 1
|
||||
numSegments = 4
|
||||
total_sent = 0
|
||||
payloadLength = 0
|
||||
packet_count = 1
|
||||
j = 0
|
||||
pc = packet_count.to_bytes(4, byteorder='little')
|
||||
i = 0
|
||||
char = ''
|
||||
new_size = os.path.getsize('./.temp/command')
|
||||
|
||||
if startFlag == False:
|
||||
#Our 34 byte beginning packet
|
||||
p1 = struct.pack(">BHHHIIBBBBBBBIBIBBB", 18, 1, 0 , 16, msgNum, 0, segnmNum, 0, 0, 8, numSegments, 3, 0, 0, 8, packRounded, 0, 0, 0)
|
||||
conn.sendto(p1, (MCAST_GRP, MCAST_PORT))
|
||||
startFlag = True
|
||||
with open('./.temp/Command',"rb") as message:
|
||||
message.seek(0)
|
||||
data = message.read(BUF_SIZE)
|
||||
while data:
|
||||
packetHeader = struct.pack(">BHHHIIBBB", 18, 1, 0, 1405, msgNum, packet_count, 0, 0, 0)
|
||||
fec = struct.pack("<IBI", packet_count, 0, new_size)
|
||||
if len(data) < BUF_SIZE:
|
||||
nullCharacterLen = BUF_SIZE - len(data)
|
||||
char = ''
|
||||
while(i < nullCharacterLen):
|
||||
char += '00'
|
||||
i = i+1
|
||||
theNull = bytes.fromhex(char)
|
||||
conn.sendto(packetHeader + fec + data + theNull, (MCAST_GRP, MCAST_PORT))
|
||||
else:
|
||||
conn.sendto(packetHeader + fec + data, (MCAST_GRP, MCAST_PORT))
|
||||
l.debug(packet_count)
|
||||
packet_count += 1
|
||||
j += 1
|
||||
|
||||
#Rate limit UDP Packets to prevent Packet Overflow on i2 machine.
|
||||
if j == 1000: #Number of packets to be sent before pausing
|
||||
time.sleep(10) #Pause for this number of seconds
|
||||
j = 0
|
||||
data = message.read(BUF_SIZE)
|
||||
else:
|
||||
data = message.read(BUF_SIZE)
|
||||
segnmNum += 1
|
||||
|
||||
# OUR TEST MESSAGE BLOCK
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
w = 3
|
||||
while w <= 3 and w != 0:
|
||||
p3 = struct.pack(">BHHHIIBBBBBBBI", 18, 1, 1, 8, msgNum, 0, segnmNum, 0, 0, 8, 0, 0, 0, 67108864)
|
||||
p4 = struct.pack(">BHHHIIBBB", 18, 1, 1, 14, msgNum, 1, segnmNum, 0, 0) + test
|
||||
conn.sendto(p3, (MCAST_GRP, MCAST_PORT))
|
||||
conn.sendto(p4, (MCAST_GRP, MCAST_PORT))
|
||||
segnmNum += 1
|
||||
w -= 1
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
@@ -6,10 +6,11 @@ import binascii
|
||||
import math
|
||||
import time
|
||||
import logging,coloredlogs
|
||||
from pathlib import Path
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
@@ -34,14 +35,22 @@ def sendFile(files, commands, numSgmts, Pri):
|
||||
else:
|
||||
l.critical("Invalid Priority Flag. 0 = Routine Message 1 = High Priority Message\n\nScript will now terminate...")
|
||||
exit()
|
||||
|
||||
# Create msgId if it doesn't exist
|
||||
msg_id_file = Path('./.temp/msgId.txt')
|
||||
if not os.path.exists(msg_id_file):
|
||||
msg_id_file_p = Path('./.temp/msgId.txt')
|
||||
msg_id_file_p.parent.mkdir(exist_ok=True, parents=True)
|
||||
msg_id_file_p.write_text("1")
|
||||
|
||||
# Get the next message ID
|
||||
with open('./.temp/msgId.txt', "r") as f:
|
||||
with open(msg_id_file, "r") as f:
|
||||
oMsgId = f.read()
|
||||
msgNum = int(oMsgId)
|
||||
f.close()
|
||||
|
||||
nMsgNum = msgNum + 1
|
||||
h = open('./.temp/msgId.txt', "w")
|
||||
h = open(msg_id_file, "w")
|
||||
h.write(str(nMsgNum))
|
||||
h.close()
|
||||
segnmNum = 0
|
||||
@@ -126,14 +135,22 @@ def sendCommand(command, Pri, msgNum = None):
|
||||
else:
|
||||
l.critical("Invalid Priority Flag. 0 = Routine Message 1 = High Priority Message\n\nScript will now terminate...")
|
||||
exit()
|
||||
|
||||
# Create msgId if it doesn't exist
|
||||
msg_id_file = Path('./.temp/msgId.txt')
|
||||
if not os.path.exists(msg_id_file):
|
||||
msg_id_file_p = Path('./.temp/msgId.txt')
|
||||
msg_id_file_p.parent.mkdir(exist_ok=True, parents=True)
|
||||
msg_id_file_p.write_text("1")
|
||||
|
||||
# Get the next message ID
|
||||
with open('./.temp/msgId.txt', "r") as f:
|
||||
with open(msg_id_file, "r") as f:
|
||||
oMsgId = f.read()
|
||||
msgNum = int(oMsgId)
|
||||
f.close()
|
||||
|
||||
nMsgNum = msgNum + 1
|
||||
h = open('./.temp/msgId.txt', "w")
|
||||
h = open(msg_id_file, "w")
|
||||
h.write(str(nMsgNum))
|
||||
h.close()
|
||||
segnmNum = 0
|
||||
@@ -174,7 +191,7 @@ def sendCommand(command, Pri, msgNum = None):
|
||||
p1 = struct.pack(">BHHHIIBBBBBBBIBIBBB", 18, 1, 0 , 16, msgNum, 0, segnmNum, 0, 0, 8, numSegments, 3, 0, 0, 8, packRounded, 0, 0, 0)
|
||||
conn.sendto(p1, (MCAST_GRP, MCAST_PORT))
|
||||
startFlag = True
|
||||
with open('./.temp/Command',"rb") as message:
|
||||
with open('./.temp/command',"rb") as message:
|
||||
message.seek(0)
|
||||
data = message.read(BUF_SIZE)
|
||||
while data:
|
||||
|
||||
@@ -9,7 +9,7 @@ from os import path, listdir, remove
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import shutil
|
||||
import requests
|
||||
import logging,coloredlogs
|
||||
from py2Lib import bit
|
||||
import Util.MachineProductCfg as MPC
|
||||
import records.LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
import gzip
|
||||
from os import remove
|
||||
import xml.dom.minidom
|
||||
@@ -21,7 +21,7 @@ for i in MPC.getPrimaryLocations():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -9,13 +9,9 @@ import aiohttp, aiofiles, asyncio
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
|
||||
import sys
|
||||
sys.path.append("./py2lib")
|
||||
sys.path.append("./Util")
|
||||
sys.path.append("./records")
|
||||
import bit
|
||||
import MachineProductCfg as MPC
|
||||
import LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
|
||||
locationIds = []
|
||||
zipCodes = []
|
||||
@@ -28,7 +24,7 @@ for i in MPC.getPrimaryLocations():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -6,13 +6,9 @@ import xml.dom.minidom
|
||||
import logging,coloredlogs
|
||||
import aiohttp, aiofiles, asyncio
|
||||
|
||||
import sys
|
||||
sys.path.append("./py2lib")
|
||||
sys.path.append("./Util")
|
||||
sys.path.append("./records")
|
||||
import bit
|
||||
import MachineProductCfg as MPC
|
||||
import LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
@@ -30,7 +26,7 @@ l.debug(airports)
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -2,7 +2,7 @@ import requests
|
||||
import json
|
||||
import os
|
||||
from datetime import datetime,timedelta
|
||||
from Util.MachineProductCfg import getAlertZones
|
||||
from util.machineProductCfg import getAlertZones
|
||||
import time
|
||||
import pytz
|
||||
import xml.dom.minidom
|
||||
@@ -10,11 +10,7 @@ import shutil
|
||||
import gzip
|
||||
import logging,coloredlogs
|
||||
import aiohttp, aiofiles, asyncio
|
||||
|
||||
|
||||
import sys
|
||||
sys.path.append("./py2lib")
|
||||
import bit
|
||||
import py2Lib.bit
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
@@ -23,7 +19,7 @@ coloredlogs.install()
|
||||
alertLocations = getAlertZones()
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
headlineApiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import requests
|
||||
import sys
|
||||
import gzip
|
||||
import uuid
|
||||
import os
|
||||
@@ -8,12 +7,9 @@ import xml.dom.minidom
|
||||
import logging,coloredlogs
|
||||
import aiohttp, aiofiles, asyncio
|
||||
|
||||
sys.path.append("./py2lib")
|
||||
sys.path.append("./Util")
|
||||
sys.path.append("./records")
|
||||
import bit
|
||||
import MachineProductCfg as MPC
|
||||
import LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
@@ -31,7 +27,7 @@ l.debug(coopIds, geocodes)
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -8,13 +8,9 @@ import xml.dom.minidom
|
||||
import logging,coloredlogs
|
||||
import aiohttp, aiofiles, asyncio
|
||||
|
||||
import sys
|
||||
sys.path.append("./py2lib")
|
||||
sys.path.append("./Util")
|
||||
sys.path.append("./records")
|
||||
import bit
|
||||
import MachineProductCfg as MPC
|
||||
import LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
@@ -35,7 +31,7 @@ for i in MPC.getMetroCities():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import requests
|
||||
import sys
|
||||
import gzip
|
||||
import uuid
|
||||
import os
|
||||
@@ -8,12 +7,9 @@ import xml.dom.minidom
|
||||
import logging,coloredlogs
|
||||
import aiohttp, aiofiles, asyncio
|
||||
|
||||
sys.path.append("./py2lib")
|
||||
sys.path.append("./Util")
|
||||
sys.path.append("./records")
|
||||
import bit
|
||||
import MachineProductCfg as MPC
|
||||
import LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
@@ -33,7 +29,7 @@ for i in MPC.getMetroCities():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import shutil
|
||||
import requests
|
||||
import logging,coloredlogs
|
||||
from py2Lib import bit
|
||||
import Util.MachineProductCfg as MPC
|
||||
import records.LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
import gzip
|
||||
from os import remove
|
||||
import xml.dom.minidom
|
||||
@@ -21,7 +21,7 @@ for i in MPC.getPrimaryLocations():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -7,13 +7,9 @@ import xml.dom.minidom
|
||||
import logging,coloredlogs
|
||||
import aiohttp, aiofiles, asyncio, asyncio
|
||||
|
||||
import sys
|
||||
sys.path.append("./py2lib")
|
||||
sys.path.append("./Util")
|
||||
sys.path.append("./records")
|
||||
import bit
|
||||
import MachineProductCfg as MPC
|
||||
import LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install()
|
||||
@@ -33,7 +29,7 @@ for i in MPC.getMetroCities():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import shutil
|
||||
import requests
|
||||
import logging,coloredlogs
|
||||
from py2Lib import bit
|
||||
import Util.MachineProductCfg as MPC
|
||||
import records.LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
import gzip
|
||||
from os import remove
|
||||
import xml.dom.minidom
|
||||
@@ -21,7 +21,7 @@ for i in MPC.getPrimaryLocations():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import requests
|
||||
import sys
|
||||
import gzip
|
||||
import uuid
|
||||
import os
|
||||
@@ -8,12 +7,9 @@ import xml.dom.minidom
|
||||
import logging, coloredlogs
|
||||
import aiohttp, aiofiles, asyncio
|
||||
|
||||
sys.path.append("./py2lib")
|
||||
sys.path.append("./Util")
|
||||
sys.path.append("./records")
|
||||
import bit
|
||||
import MachineProductCfg as MPC
|
||||
import LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
@@ -32,7 +28,7 @@ l.debug(pollenIds, geocodes)
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import shutil
|
||||
import logging,coloredlogs
|
||||
import datetime
|
||||
from py2Lib import bit
|
||||
import Util.MachineProductCfg as MPC
|
||||
import records.LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
import gzip
|
||||
from os import remove
|
||||
import xml.dom.minidom
|
||||
@@ -21,7 +21,7 @@ for i in MPC.getTideStations():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import shutil
|
||||
import requests
|
||||
import logging,coloredlogs
|
||||
from py2Lib import bit
|
||||
import Util.MachineProductCfg as MPC
|
||||
import records.LFRecord as LFR
|
||||
import py2Lib.bit
|
||||
import util.machineProductCfg as MPC
|
||||
import records.lfRecord as LFR
|
||||
import gzip
|
||||
from os import remove
|
||||
import xml.dom.minidom
|
||||
@@ -21,7 +21,7 @@ for i in MPC.getPrimaryLocations():
|
||||
|
||||
# Open the config file and make it accessible via "cfg"
|
||||
import json
|
||||
with open("conf.json", "r") as file:
|
||||
with open("config.json", "r") as file:
|
||||
cfg = json.load(file)
|
||||
|
||||
apiKey = cfg["twcApiKey"]
|
||||
|
||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
Reference in New Issue
Block a user