"""
import os
import sys
import requests
import csv
from bs4 import BeautifulSoup
import logging

import loggerSetup
import updateCSV

# Set up logger
LOG_DIR = os.path.join(sys.path[0], "logs/TAPtableRecordingLog")
LOG_NAME = "TAPtableRecordingLog"
LOG_DATE_TIME_FORMAT = "%Y-%m-%d"
logger = loggerSetup.setup(__name__, LOG_DIR, LOG_NAME, LOG_DATE_TIME_FORMAT)

# local script imports
#from compareEventTables import compareEvents
#from dataCollectionAndOutput import collectEventData

FILENAME = "targetListComparison.txt"
TAP_TARGET_TABLE_URL = "http://robonet.lcogt.net/temp/tap1mlist_kepler_short.html"
TEST_TAP_TARGET_TABLE_FILEPATH = "/home/scross/Documents/Workspace/RoguePlanetMicrolensingProject/webpageAccess/testing/shortTargetTableComparison/TAPtest2.html"
onlineTAPevents = {}

# set up and create ouptut directory and filename for TAP target table
TAP_TARGET_TABLE_OUTPUT_FILENAME = "TAPtargetTable.csv"
TAP_TARGET_TABLE_OUTPUT_DIR = os.path.join(sys.path[0], "TAPtargetTable")
TAP_TARGET_TABLE_OUTPUT_FILEPATH = os.path.join(TAP_TARGET_TABLE_OUTPUT_DIR, TAP_TARGET_TABLE_OUTPUT_FILENAME)
if not os.path.exists(TAP_TARGET_TABLE_OUTPUT_DIR):
from dataCollectionAndOutput import eventDataCollection # collecting data from survey sites and ARTEMIS, as well as outputting HTML summary page and event trigger record .csv
import updateCSV
import eventTablesComparison
import mailAlert # script for sending emails by executing command line tool

requests.packages.urllib3.disable_warnings() # to disable warnings when accessing insecure sites

DEBUGGING_MODE = True # Turn this flag on if modifying and testing code - turn it off when actively being used

# create and set up filepath and directory for logs -
# log dir is subdir of script
LOG_DIR = os.path.join(sys.path[0], "logs/ROGUElog")
LOG_NAME = "ROGUElog"
LOG_DATE_TIME_FORMAT = "%Y-%m-%d"
if DEBUGGING_MODE:
	logger = loggerSetup.setup(__name__, LOG_DIR, LOG_NAME, LOG_DATE_TIME_FORMAT, consoleOutputOn=True, consoleOutputLevel = "DEBUG")
else:
	logger = loggerSetup.setup(__name__, LOG_DIR, LOG_NAME, LOG_DATE_TIME_FORMAT, consoleOutputOn=False, consoleOutputLevel = "DEBUG")

# set up filepath and directory for local copy of newest microlensing event
EVENT_FILENAME = "lastEvent.txt"
EVENT_DIR = os.path.join(sys.path[0], "lastEvent")
EVENT_FILEPATH = os.path.join(EVENT_DIR, EVENT_FILENAME)
if not os.path.exists(EVENT_DIR):
	os.makedirs(EVENT_DIR)

# Set up filepath for .csv file of TAP event triggers
TAP_DIR = os.path.join(sys.path[0], "TAPtargetTable")
TAP_FILENAME = "TAPtargetTable.csv"
TAP_FILEPATH = os.path.join(TAP_DIR, TAP_FILENAME)