def set_timezone(self, tz): ''' Set the timezone for the start and ending dates ''' if tz not in TimeZone.getAvailableIDs(): raise Exception('Incompatible timezone.\n Application quitting.') self.timezone = tz
def set_tzdss(self, tz): ''' Specifies time zone to use for data stored to a HEC-DSS file. If not specified, the data will be stored to the HEC-DSS file in the time zone specified in the USGS text. Valid values for dss_time_zone are valid shef_time_zone values plus any valid Java time zone ID (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). ''' if tz not in TimeZone.getAvailableIDs(): sys.exit(1) #raise Exception('Incompatible timezone.\n Application quitting.') self.tzdss = tz
__all__ = ['CwmsRADAR'] from java.util import TimeZone from hec.script import Constants import os import sys import tempfile import string import json import logging import cwms_data2dss # A few constants True = Constants.TRUE False = Constants.FALSE time_zones = TimeZone.getAvailableIDs() # modify the program name to reflect the imported module cwmsdata_file = cwms_data2dss.__file__.replace("$py.class", ".py") cwms_data2dss.progName = os.path.split(cwmsdata_file)[1] class CwmsRADAR(): ''' CWMS Data class used to set inputs that will ultimately build the sys.argv that the cwms_data2dss.py module will use. ''' def __init__(self): ''' Initialize the class '''