# Path: dcmetrometrics/eles/models.py
# class KeyStatuses(WebJSONMixin, EmbeddedDocument):
# class UnitPerformancePeriod(WebJSONMixin, EmbeddedDocument):
# class UnitPerformanceSummary(WebJSONMixin, EmbeddedDocument):
# class SymptomCodeOld(Document):
# class SymptomCode(Document):
# class Station(WebJSONMixin, DataWriteable, Document):
# class Unit(WebJSONMixin, DataWriteable, Document):
# class UnitStatus(WebJSONMixin, DataWriteable, Document):
# class DailyServiceReport(WebJSONMixin, DataWriteable, Document):
# class UnitTypeServiceReport(WebJSONMixin, DataWriteable, EmbeddedDocument):
# class SystemServiceReport(WebJSONMixin, DataWriteable, Document):
# class ElevatorAppState(Document):
# class EscalatorAppState(Document):
#   def get_last_symptoms(cls, unit_ids = None):
#   def select_key_statuses(cls, statuses):
#     def getStatus(timeToStatusDict):
#   def __str__(self):
#   def make_new_format(self):
#   def add(cls, code, description):
#   def __str__(self):
#   def add(cls, description):
#   def other_lines(self):
#   def other_station_code(self):
#   def line_code1(self):
#   def line_code2(self):
#   def line_code3(self):
#   def get_shared_stations(self):
#   def add(cls, code, long_name, medium_name, short_name, lines, all_lines, all_codes):
#   def _get_units(self, shared = True, escalators = True, elevators = True):
#   def get_shared_units(self, **kwargs):
#   def get_units(self, **kwargs):
#   def get_escalators(self):
#   def get_elevators(self):
#   def get_recent_statuses(self, n = 20):
#   def get_station_directory(cls):
#   def is_elevator(self):
#   def is_escalator(self):
#   def __str__(self):
#   def add(cls, curTime = None, **kwargs):
#   def get_statuses(self, *args, **kwargs):
#   def compute_performance_summary(self, statuses = None, save = False, end_time = None):
#   def update(self, unit_status):
#   def _get_unit_statuses(object_id=None, start_time = None, end_time = None):
#   def compute_key_statuses(self, save = False):
#   def compute_daily_service_reports(self, save = False, statuses = [],
#      start_day = date(2013, 6, 1),
#      last_day = None):
#   def clean(self):
#   def __str__(self):
#   def denormalize(self):
#   def compute_metro_open_time(self):
#   def _add_timezones(self):
#   def is_active(self):
#   def start_time(self):
#   def compute_for_unit(cls, unit, day, statuses = None):
#   def from_daily_service_reports(cls, reports):
#   def compute_for_day(cls, day, reports = None, save = True):
#   def __init__(self, *args, **kwargs):
#   def get(cls):
#         G = dbGlobals.G()


from dcmetrometrics.eles import models as models_eles
from dcmetrometrics.hotcars import models as models_hotcars
import sys
import logging
  import xml.etree.ElementTree as ET
  import json
and a json file with an array of urls.

The json file is used with grunt in order to crawl dcmetrometrics.com and regenerate
the static version of the site.
"""


#######################
# Set up logging
sh = logging.StreamHandler(sys.stderr)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger('SiteMapGenerator')
logger.setLevel(logging.DEBUG)
logger.addHandler(sh)
#######################

URL_ROOT = 'http://localhost:80'

def unit_urls():
  logger.info("Generating Unit URLS...")
  units = models_eles.Unit.objects
  return ['{URL_ROOT}/unit/%s'%(unit.unit_id) for unit in units]

def hotcar_urls():
  logger.info("Generating HotCar URLS...")
  hotcars = models_hotcars.HotCarReport.objects
  return list(set(['{URL_ROOT}/hotcars/detail/%s'%(h.car_number) for h in hotcars]))

def station_urls():
  logger.info("Generating Station URLS...")  

# Path: dcmetrometrics/eles/models.py
# class KeyStatuses(WebJSONMixin, EmbeddedDocument):
# class UnitPerformancePeriod(WebJSONMixin, EmbeddedDocument):
# class UnitPerformanceSummary(WebJSONMixin, EmbeddedDocument):
# class SymptomCodeOld(Document):
# class SymptomCode(Document):
# class Station(WebJSONMixin, DataWriteable, Document):
# class Unit(WebJSONMixin, DataWriteable, Document):
# class UnitStatus(WebJSONMixin, DataWriteable, Document):
# class DailyServiceReport(WebJSONMixin, DataWriteable, Document):
# class UnitTypeServiceReport(WebJSONMixin, DataWriteable, EmbeddedDocument):
# class SystemServiceReport(WebJSONMixin, DataWriteable, Document):
# class ElevatorAppState(Document):
# class EscalatorAppState(Document):
#   def get_last_symptoms(cls, unit_ids = None):
#   def select_key_statuses(cls, statuses):
#     def getStatus(timeToStatusDict):
#   def __str__(self):
#   def make_new_format(self):
#   def add(cls, code, description):
#   def __str__(self):
#   def add(cls, description):
#   def other_lines(self):
#   def other_station_code(self):
#   def line_code1(self):
#   def line_code2(self):
#   def line_code3(self):
#   def get_shared_stations(self):
#   def add(cls, code, long_name, medium_name, short_name, lines, all_lines, all_codes):
#   def _get_units(self, shared = True, escalators = True, elevators = True):
#   def get_shared_units(self, **kwargs):
#   def get_units(self, **kwargs):
#   def get_escalators(self):
#   def get_elevators(self):
#   def get_recent_statuses(self, n = 20):
#   def get_station_directory(cls):
#   def is_elevator(self):
#   def is_escalator(self):
#   def __str__(self):
#   def add(cls, curTime = None, **kwargs):
#   def get_statuses(self, *args, **kwargs):
#   def compute_performance_summary(self, statuses = None, save = False, end_time = None):
#   def update(self, unit_status):
#   def _get_unit_statuses(object_id=None, start_time = None, end_time = None):
#   def compute_key_statuses(self, save = False):
#   def compute_daily_service_reports(self, save = False, statuses = [],
#      start_day = date(2013, 6, 1),
#      last_day = None):
#   def clean(self):
#   def __str__(self):
#   def denormalize(self):
#   def compute_metro_open_time(self):
#   def _add_timezones(self):
#   def is_active(self):
#   def start_time(self):
#   def compute_for_unit(cls, unit, day, statuses = None):
#   def from_daily_service_reports(cls, reports):
#   def compute_for_day(cls, day, reports = None, save = True):
#   def __init__(self, *args, **kwargs):
#   def get(cls):
#         G = dbGlobals.G()


# Path: utils/generate_site_map.py
from dcmetrometrics.eles import models as models_eles
from dcmetrometrics.hotcars import models as models_hotcars
import sys
import logging
  import xml.etree.ElementTree as ET
  import json

and a json file with an array of urls.

The json file is used with grunt in order to crawl dcmetrometrics.com and regenerate
the static version of the site.
"""


#######################
# Set up logging
sh = logging.StreamHandler(sys.stderr)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger('SiteMapGenerator')
logger.setLevel(logging.DEBUG)
logger.addHandler(sh)
#######################

URL_ROOT = 'http://localhost:80'

def unit_urls():
  logger.info("Generating Unit URLS...")
  units = models_eles.Unit.objects
  return ['{URL_ROOT}/unit/%s'%(unit.unit_id) for unit in units]

def hotcar_urls():
  logger.info("Generating HotCar URLS...")
  hotcars = models_hotcars.HotCarReport.objects
  return list(set(['{URL_ROOT}/hotcars/detail/%s'%(h.car_number) for h in hotcars]))

def station_urls():
  logger.info("Generating Station URLS...")  

  stations = models_eles.Station.objects