def _ParseTimezoneOption(self, options):
    """Parses the timezone options.

    Args:
      options (argparse.Namespace): command line arguments.

    Raises:
      BadConfigOption: if the options are invalid.
    """
    time_zone_string = self.ParseStringOption(options, 'timezone')
    if isinstance(time_zone_string, py2to3.STRING_TYPES):
      if time_zone_string.lower() == 'list':
        self.list_timezones = True

      elif time_zone_string:
        try:
          pytz.timezone(time_zone_string)
        except pytz.UnknownTimeZoneError:
          raise errors.BadConfigOption(
              'Unknown time zone: {0:s}'.format(time_zone_string))

        self._preferred_time_zone = time_zone_string
def _ParseTimezoneOption ( self , options ) : time_zone_string = self . ParseStringOption ( options , 'timezone' ) if isinstance ( time_zone_string , py2to3 . STRING_TYPES ) : if time_zone_string . lower ( ) == 'list' : self . list_timezones = True elif time_zone_string : try : pytz . timezone ( time_zone_string ) except pytz . UnknownTimeZoneError : raise errors . BadConfigOption ( 'Unknown time zone: {0:s}' . format ( time_zone_string ) ) self . _preferred_time_zone = time_zone_string
Parses the timezone options.

    Args:
      options (argparse.Namespace): command line arguments.

    Raises:
      BadConfigOption: if the options are invalid.