Пример #1
0
 def toDotDict(self):
     """
     Convenience function to use if you want to use dot notation recursively
     everywhere within the parsed JSON.
     """
     return DotDict(dict([(k, convertToDotDictRecurse(v))
                          for k, v in self.__dict__.iteritems()]))
Пример #2
0
 def toDotDict(self):
     """
     Convenience function to use if you want to use dot notation recursively
     everywhere within the parsed JSON.
     """
     return DotDict(
         dict([(k, convertToDotDictRecurse(v))
               for k, v in self.__dict__.iteritems()]))
Пример #3
0
 def jsonHandler(topicPrefix, body):
     return handler(topicPrefix,
                    convertToDotDictRecurse(json.loads(body)))
Пример #4
0
def loadConfig(path):
    f = open(path, 'r')
    j = json.load(f)
    return convertToDotDictRecurse(j)
Пример #5
0
 def jsonHandler(topicPrefix, body):
     return handler(topicPrefix, convertToDotDictRecurse(json.loads(body)))
Пример #6
0
def loadConfig(path):
    f = open(path, 'r')
    j = json.load(f)
    return convertToDotDictRecurse(j)
Пример #7
0
from geocamUtil import anyjson as json
from geocamUtil.models.ExtrasDotField import convertToDotDictRecurse
from geocamUtil.loader import LazyGetModelByName

from xgds_status_board.models import StatusboardAnnouncement, StatusboardEvent, SubsystemGroup, Subsystem
from xgds_status_board import settings

from subprocess import Popen, PIPE
from time import sleep as time_sleep


# pylint: disable=E1101
default_timezone_offset = 0
XGDS_STATUS_BOARD_TEMPLATE_LIST = list(settings.XGDS_STATUS_BOARD_HANDLEBARS_DIR)
timezones = convertToDotDictRecurse(settings.STATUS_BOARD_TIMEZONES)


#print 'CALCULATING TIMEZONES WE HAVE %d' % len(timezones)
for timezone in timezones:
    timezone.tzobject = pytz.timezone(timezone.code)


def getMultiTimezones(time):
    """
    given a datetime that is in utc, return that time as the timezones defined in settings.
    """
    utc_time = utc.localize(time)
    return [(tz.name, utc_time.astimezone(tz.tzobject), tz.color)
            for tz in timezones]