Skip to content

Commit

Permalink
* Fix code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sfider committed Dec 8, 2024
1 parent a80b5c9 commit 64c7eed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions watson/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,25 @@


hour_shift = 0


def set_hour_shift(hour):
global hour_shift
hour_shift = hour


def shifted_floor(time, timeframe):
return time.shift(hours=-hour_shift).floor(timeframe).shift(hours=hour_shift)
time = time.shift(hours=-hour_shift)
time = time.floor(timeframe)
time = time.shift(hours=hour_shift)
return time


def shifted_ceil(time, timeframe):
return time.shift(hours=-hour_shift).ceil(timeframe).shift(hours=hour_shift)
time = time.shift(hours=-hour_shift)
time = time.ceil(timeframe)
time = time.shift(hours=hour_shift)
return time


def shifted_from(from_):
Expand Down Expand Up @@ -83,7 +91,7 @@ def __gte__(self, other):


class Span(object):
def __init__(self, start, stop, timeframe = 'day'):
def __init__(self, start, stop, timeframe='day'):
self.timeframe = timeframe
self.start = shifted_floor(start, self.timeframe)
self.stop = shifted_ceil(stop, self.timeframe)
Expand Down
2 changes: 1 addition & 1 deletion watson/watson.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def report(self, from_, to, current=None, projects=None, tags=None,
cur['tags'], id="current")

span = self.frames.span(from_, to)

frames_by_project = sorted_groupby(
self.frames.filter(
projects=projects or None, tags=tags or None,
Expand Down

0 comments on commit 64c7eed

Please sign in to comment.