Commit cf79c7b2 authored by Vincent Pelletier's avatar Vincent Pelletier

Disable rescaling when maximum period is exceeded.

parent 29955e09
......@@ -1220,6 +1220,7 @@ def main():
next_period_data = ((x, y[4] * AUTO_PERIOD_COEF) for (x, y) in
sorted(period_parser.iteritems(), key=lambda x: x[1][4])).next
period, to_next_period = next_period_data()
original_period = period
earliest_date = latest_date = None
def getNextPeriod():
# datetime is slow (compared to string operations), but not many choices
......@@ -1351,13 +1352,14 @@ def main():
if hit_date < earliest_date or earliest_date is None:
earliest_date = hit_date
next_period = getNextPeriod()
if latest_date > next_period:
try:
while latest_date > next_period:
period, to_next_period = next_period_data()
next_period = getNextPeriod()
except StopIteration:
pass
try:
while latest_date > next_period:
period, to_next_period = next_period_data()
next_period = getNextPeriod()
except StopIteration:
to_next_period = None
if original_period != period:
original_period = period
if show_progress:
print >> sys.stderr, 'Increasing period to', period, '...',
old_date_format = date_format
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment