| LEFT | RIGHT |
|---|---|
| 1 #!/usr/bin/python2.5 | 1 #!/usr/bin/python2.5 |
| 2 | 2 |
| 3 # Copyright (C) 2007 Google Inc. | 3 # Copyright (C) 2007 Google Inc. |
| 4 # | 4 # |
| 5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
| 7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
| 8 # | 8 # |
| 9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 # | 10 # |
| (...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2445 yield (self.service_id, date, unicode(exception_type)) | 2445 yield (self.service_id, date, unicode(exception_type)) |
| 2446 | 2446 |
| 2447 def GetCalendarDatesFieldValuesTuples(self): | 2447 def GetCalendarDatesFieldValuesTuples(self): |
| 2448 """Return a list of date execeptions""" | 2448 """Return a list of date execeptions""" |
| 2449 result = [] | 2449 result = [] |
| 2450 for date_tuple in self.GenerateCalendarDatesFieldValuesTuples(): | 2450 for date_tuple in self.GenerateCalendarDatesFieldValuesTuples(): |
| 2451 result.append(date_tuple) | 2451 result.append(date_tuple) |
| 2452 result.sort() # helps with __eq__ | 2452 result.sort() # helps with __eq__ |
| 2453 return result | 2453 return result |
| 2454 | 2454 |
| 2455 def SetDateHasService(self, date, has_service=True, | 2455 def SetDateHasService(self, date, has_service=True, problems=None): |
| 2456 problems=None): | |
|
Tom
2009/10/26 23:30:33
looks like it fits on previous line
jirka
2009/10/27 11:31:52
On 2009/10/26 23:30:33, Tom wrote:
> looks like it
| |
| 2457 if date in self.date_exceptions and problems: | 2456 if date in self.date_exceptions and problems: |
| 2458 problems.DuplicateID(('service_id', 'date'), | 2457 problems.DuplicateID(('service_id', 'date'), |
| 2459 (self.service_id, date), | 2458 (self.service_id, date), |
| 2460 type=TYPE_WARNING) | 2459 type=TYPE_WARNING) |
| 2461 self.date_exceptions[date] = has_service and 1 or 2 | 2460 self.date_exceptions[date] = has_service and 1 or 2 |
| 2462 | 2461 |
| 2463 def ResetDateToNormalService(self, date): | 2462 def ResetDateToNormalService(self, date): |
| 2464 if date in self.date_exceptions: | 2463 if date in self.date_exceptions: |
| 2465 del self.date_exceptions[date] | 2464 del self.date_exceptions[date] |
| 2466 | 2465 |
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4234 def __init__(self, *args, **kwargs): | 4233 def __init__(self, *args, **kwargs): |
| 4235 """Initialize a new ShapeLoader object. | 4234 """Initialize a new ShapeLoader object. |
| 4236 | 4235 |
| 4237 See Loader.__init__ for argument documentation. | 4236 See Loader.__init__ for argument documentation. |
| 4238 """ | 4237 """ |
| 4239 Loader.__init__(self, *args, **kwargs) | 4238 Loader.__init__(self, *args, **kwargs) |
| 4240 | 4239 |
| 4241 def Load(self): | 4240 def Load(self): |
| 4242 self._LoadShapes() | 4241 self._LoadShapes() |
| 4243 return self._schedule | 4242 return self._schedule |
| LEFT | RIGHT |