Skip to content

Commit

Permalink
Format to flake8 standards
Browse files Browse the repository at this point in the history
  • Loading branch information
BPM_ccase committed Jan 6, 2023
1 parent c952a92 commit e63d164
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/orca_hls_utils/DateRangeHLSStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ def get_readable_clipname(hydrophone_id, cliptime_utc):
# cliptime is of the form 2020-09-27T00/16/55.677242Z
cliptime_utc = timezone('UTC').localize(cliptime_utc)
date = cliptime_utc.astimezone(timezone('US/Pacific'))
date_format='%Y_%m_%d_%H_%M_%S_%Z'
date_format = '%Y_%m_%d_%H_%M_%S_%Z'
clipname = date.strftime(date_format)
return hydrophone_id + "_" + clipname, date

#TODO: Handle date ranges that don't exist

# TODO: Handle date ranges that don't exist
class DateRangeHLSStream():
"""
stream_base = 'https://s3-us-west-2.amazonaws.com/streaming-orcasound-net/rpi_orcasound_lab'
Expand Down Expand Up @@ -66,7 +67,7 @@ def __init__(self, stream_base, polling_interval, start_unix_time, end_unix_time
self.folder_name = tokens[1]
prefix = self.folder_name + "/hls/"

# returns folder names corresponding to epochs, this grows as more data is added, we should probably maintain a list of
# returns folder names corresponding to epochs, this grows as more data is added, we should probably maintain a list of
# hydrophone folders that exist
all_hydrophone_folders = s3_utils.get_all_folders(self.s3_bucket, prefix=prefix)
print("Found {} folders in all for hydrophone".format(len(all_hydrophone_folders)))
Expand Down Expand Up @@ -98,7 +99,7 @@ def get_next_clip(self, current_clip_name=None):

if time_to_sleep > 0:
time.sleep(time_to_sleep)

# read in current m3u8 file
# stream_url for the current AWS folder
stream_url = "{}/hls/{}/live.m3u8".format(
Expand Down

0 comments on commit e63d164

Please sign in to comment.